Import DLLs

T

Thomas Klein

Hello newsgroup,

I am new to C# and need to import a DLLs from a software vendor. I have
already successfully tried to import a Win32-DLL in this way:

/*
* import DLL
*/
[DllImport("kernel32.dll")]

/*
* Prototype for external function
*/
public static extern bool Beep(int frequency, int duration);


My vendor's DLL is located in D:\xxx\dev.dll.
How can I import this DLL and use its defined functions?

Thynk you very much for your help!
Thomas
 
M

Mattias Sjögren

How can I import this DLL and use its defined functions?

Assuming the DLL exports functions as static entry points the same way
Win32 DLLs do, you use the same technique (with the DllImport
attribute and so on). Of course you need to know the names and
signatures of the functions you want to call.


Mattias
 

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

Top