473,325 Members | 2,671 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

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 IsBottomMixValid.
Code not relevant for the question has been removed.
This method IsBottomMixValid has one parameter and the type for this
parameter is MeltPracDataGmix meaning passing class reference
MeltPracDataGmix.

Now to my question the definition for class MeltPracDataGmix does not exist
in the same project as
the class AvestaPlantFunc. Class MeltPracDataGmix 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 MeltPracDataGmix 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 IsBottomMixValid(MeltPracDataGmix mix)
{
//here is there some code
}
}
}

//Tony
Mar 20 '06 #1
2 1662
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 IsBottomMixValid.
Code not relevant for the question has been removed.
This method IsBottomMixValid has one parameter and the type for this
parameter is MeltPracDataGmix meaning passing class reference
MeltPracDataGmix.

Now to my question the definition for class MeltPracDataGmix does not exist
in the same project as
the class AvestaPlantFunc. Class MeltPracDataGmix 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 IsBottomMixValid.
Code not relevant for the question has been removed.
This method IsBottomMixValid has one parameter and the type for this
parameter is MeltPracDataGmix meaning passing class reference
MeltPracDataGmix.

Now to my question the definition for class MeltPracDataGmix does not exist
in the same project as
the class AvestaPlantFunc. Class MeltPracDataGmix 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 MeltPracDataGmix 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 IsBottomMixValid(MeltPracDataGmix 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
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...
7
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...
4
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...
7
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...
0
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...
1
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...
14
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...
3
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...
0
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...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.