Import class from a dll

  • Thread starter Thread starter Romain TAILLANDIER
  • Start date Start date
R

Romain TAILLANDIER

Hi group

I have have different C# DLL.
Each containing one class, responding to an interface ImyClass.

i want to import the full class from one of this dll

something like :
[DllImport("myDll"..)] MyClass;

Or, I want to create an instance of the class, wich seems to be easier ...

Something like :
MyClass A = New [DllImport("MyDll"...)] MyClass();


How Can I do ?
(Am I clear ?? :s)

Thank for help :)
ROM
 
something like :
[DllImport("myDll"..)] MyClass;

You don't have to do this, as long as you link the assembly correctly you
just use:

MyClass A = new MyClass();

and it should work for you.


/m
 
Romain,

DllImport is only used for unmanaged DLLs.

To use managed DLLs, you just have to reference them, using the
command line compiler's /r switch or the Add Reference option in
Visual Studio.



Mattias
 
Back
Top