HI,
I have a file called rdcclient.dll and rdcba.dll. These files i added as a reference to my project.
First I want to create a instance of rdcclient class.
Then i want to create a instance of rdcba class. with in this rdcba, there are number of subclasses called , classlocation, classdata, classbuilding etc.
First i need to create instance for classdata (parameter : rdcclient.clientid). then i want to create instance for other classes.
I dont know how to create this in c#
Suggest and write to :[email protected]
Regards
Ramesh
AlanPosted Nov 28, 2008, 5:25 AM
Once you've added a reference to a dll to your project, you can create instances of classes in the dll just as if they had been defined in your own project. However, there are two things to watch:
1. The classes in the dll should be declared as 'public'. Otherwise, they will be 'internal' by default and will only be accessible from within the dll itself.
2. If the classes in the dll are within a namespace, it's a good idea to add a 'using' directive for that namespace to your project so that you don't have to fully qualify the class name.
To illustrate these points suppose the rdcclient class is public and in a namespace also called rdcclient. Suppose also that its constructor takes no arguments. You could then create an instance of it in your project with the following code:
using rdcclient;
//.....
rdcclient rc = new rdcclient();
Similarly, if rdbca and its subclasses were all public and in a namespace called rdbca, you could do:
using rdcba;
//.....
rdcba rb = new rdcba();
classdata cd = new classdata(rc.clientid);