Home All Groups Group Topic Archive Search About
Author
10 Mar 2006 8:41 AM
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

Author
10 Mar 2006 6:39 PM
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

--
Mattias Sjögren [C# MVP]  mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.

Bookmark and Share