For most .NET dlls, you can add them as a reference, and then "import" them into your code by means of using directive (eg using mydll;
). I have a .NET binary compiled with MSVC which I can add as a reference but it never appears in the using directive. Why could this be happening?
If you're using a C++/C library, you will have to use dllimport, C# isn't going to just "see" unmanaged code.
[DLLImport( "mydll.dll" )];
static extern void MyMethod(int parm1, int parm2);
then you should be able to call MyMethod from your code as you would any other.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.