473,662 Members | 2,376 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to use class library when anthor class is used

Hello!

I'm trying to build a class library which has a class called
AvestaPlantFunc .
In this project building a class libray exist a class called
AvestaPlantFunc . In this class is there a method called IsBottomMixVali d.
Code not relevant for the question has been removed.
This method IsBottomMixVali d has one parameter and the type for this
parameter is MeltPracDataGmi x meaning passing class reference
MeltPracDataGmi x.

Now to my question the definition for class MeltPracDataGmi x does not exist
in the same project as
the class AvestaPlantFunc . Class MeltPracDataGmi x exist in another project
that build the exe file.

When a class has a reference to another class as in my example is it
nesessary that the full definition to class MeltPracDataGmi x is existing in
the same project.

I assume if this was C++ it would be enough to include the class declaration
which is the header file and not the implementation.

But in C# we don't have any header files. So how do I do here?

What is the solution to this problem when the class need another class.
using System;
using MeltPracData;

namespace Common
{

public class AvestaPlantFunc
{
public bool IsBottomMixVali d(MeltPracDataG mix mix)
{
//here is there some code
}
}
}

//Tony
Mar 20 '06 #1
2 1680
tony wrote:
I'm trying to build a class library which has a class called
AvestaPlantFunc .
In this project building a class libray exist a class called
AvestaPlantFunc . In this class is there a method called IsBottomMixVali d.
Code not relevant for the question has been removed.
This method IsBottomMixVali d has one parameter and the type for this
parameter is MeltPracDataGmi x meaning passing class reference
MeltPracDataGmi x.

Now to my question the definition for class MeltPracDataGmi x does not exist
in the same project as
the class AvestaPlantFunc . Class MeltPracDataGmi x exist in another project
that build the exe file.


You need to add a reference to that project then. Just adding the
reference should be enough.

Jon

Mar 20 '06 #2
Hi Tony,
when you want to use a type definition that has been defined inside a
different assembly (either dll or exe) you will need to make sure you include
the assembly as a reference to your project, then if the object you want to
use is inside a different namespace you will have to import the namespace
using the "using" keyword or use the fully qualified name.

You do not need source code because .Net is self describing because each
assembly contains metadata about all of the types declared inside of it. By
just including the reference to an assembly you will get all the information
you need, without having to have source code or header files.

In VS2005 you can reference either a DLL or an EXE but in VS2000 you can
only reference DLL's

Mark Dawson
http://www.markdawson.org
"tony" wrote:
Hello!

I'm trying to build a class library which has a class called
AvestaPlantFunc .
In this project building a class libray exist a class called
AvestaPlantFunc . In this class is there a method called IsBottomMixVali d.
Code not relevant for the question has been removed.
This method IsBottomMixVali d has one parameter and the type for this
parameter is MeltPracDataGmi x meaning passing class reference
MeltPracDataGmi x.

Now to my question the definition for class MeltPracDataGmi x does not exist
in the same project as
the class AvestaPlantFunc . Class MeltPracDataGmi x exist in another project
that build the exe file.

When a class has a reference to another class as in my example is it
nesessary that the full definition to class MeltPracDataGmi x is existing in
the same project.

I assume if this was C++ it would be enough to include the class declaration
which is the header file and not the implementation.

But in C# we don't have any header files. So how do I do here?

What is the solution to this problem when the class need another class.
using System;
using MeltPracData;

namespace Common
{

public class AvestaPlantFunc
{
public bool IsBottomMixVali d(MeltPracDataG mix mix)
{
//here is there some code
}
}
}

//Tony

Mar 20 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
12960
by: A_StClaire_ | last post by:
hi, I'm working on a project spanning five .cpp files. each file was used to define a class. the first has my Main and an #include for each of the other files. problem is my third file needs to access the class defined in my second file and I can't figure out how to work this right. if I use an #include in my third file, my Main gives me a compile-time class redefinition error. if I don't, the third file can't "see" the second
7
4696
by: Josef | last post by:
Hello, I want to create a C# class library which I can use in an Excel VBA macro. I created a C# class library and set the "Register for COM Interop" option in Visual Studio to TRUE. Now in Excel I can use this library but the intellisense does not show any properties or functions of the class. Do I have to add any keywords or GUID to each public function and property in C#? Do I have to load the library to the global assembly cache?...
4
1760
by: Brian Shannon | last post by:
I am playing around with class libraries trying to understand how they work. I created a class library, library.vb. I placed the library.dll into the bin directory and set my reference. If I update the library.dll can I Just place the new .dll in the bin directory or do I need to recompile my program. During testing I am just placing the new library.dll in the bin directory and don't get any of the updates I made until I re-reference...
7
2524
by: SevDer | last post by:
Hi I have a class library that needs to download the HTML in a specific page of ours with provided querystring. When I open this URL with any browser, it loads fine. When I do WebRequest from Web Project it is again fine. However whenever I do this request from this class library, it fails. I put every kind of user permission to the actual folder, and through inetmgr. Right now everyone has full control. But still I got the problem.
0
1749
by: tony | last post by:
Hello! I have one solution file that consist of three project. One project that build the exe file called A One project that build a user control dll. In this user control we have a class called B One project that build a class library dll. In this class library we have a class called C In the user control project I have a project reference to the class library.
1
5351
by: Zoe Hart | last post by:
Prior to VS2005 I configured my applications via the appSettings section of the app.config file. When I developed a class library, I used ConfigurationManager.AppSettings(settingName) syntax and the compiler didn't care that no such settings existed yet. The settings were ultimately managed in the app.config file of the host applicaton that used the classes in the library. I'm not sure how to handle configuration settings for a class...
14
18739
by: budy_ludy | last post by:
Hi All, I am new to vb .net, I have an ArrayList and i store class objects in it, and later i want to retrieve each ArrayList items and type cast to the class, How can it be done ? I used CType for casting but it is throwing exception.
3
2635
by: Martyn Fewtrell | last post by:
Hi there. First of all let me apologise for this is a somewhat general question to which I would be interested in any opinions. As far as I can see when I create a web application the recommended location for the database is the app_data folder. The recommended location for code files and datasets/table adapters appears to be the app_code folder. This set up appears to work reasonably well although it results in the all the code...
0
2400
by: drawing in aspnet | last post by:
Question about putting the data layer in a separate class library. I keep reading that the data layer should be separated from the presentation layer and put in its own class library. I am trying to do this but running into a problem. I'm hoping someone can point me in the right direction. I first create a class library (all code in C#) and within this class library create a very simple Sql Server Express database (.mdb) file. It's...
0
8432
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8343
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8856
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8762
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8633
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7365
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6185
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4179
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2762
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.