how to use a DLL in C#

  • Thread starter Thread starter Fabian Ruranski
  • Start date Start date
F

Fabian Ruranski

I use a dll in Vb.net It work fine. But i have Problems with the C# syntax.
Can somone help me??

the Vb sytax is:

Dim xx As New boseMatlabClass.MatlabClass1Class
xx.mlEXEcute("figure(99)")


thanks
 
within C#, you first need to add a reference to that DLL,
from Add References in the Server Explorer(if at all u
have the VS.NET) else, you could specify the reference in
the CSC command at the .NET command prompt.

Next, add the following line within your code.
using <theDLLName>;

Once done, you could use

<theDLLName>.ClassName oMyObject = new
<theDLLName>.ClassName();

This creates an object of your class.

Next.. well, you already knew...
oMyObject.<TheFunctionName>

Thats it
 
Actually, it has nothing to do with the name of the DLL, instead it's the
namespace.class[.nestedClass].
Namespaces don't have to relate to the DLL name. I can have a DLL called
"x.dll" with namespace "Fun".

-mike
MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top