Reputation: 9
I had one C++ project written in MFC and some of the project are of DLL type. I wanted to use those dll in my C# code(using DllImport
).
I tried to add as a reference but could not able to and getting an error. Do i need to copy those dll's in any of particular location? How my code is going to link those dll's?
Upvotes: 0
Views: 626
Reputation: 5797
You can't add a reference to a native DLL. In DllImport
you just import the DLL at runtime so be careful with the path to the DLL if it is not in the same directory as your managed application.
A problem with C++-DLLs is, that the function names in that DLLs can be decorated so you have to find out that decorated name before using it.
Upvotes: 1