March 17th, 2009, 02:37 PM
I have a C++ DLL/IDL, comprised of several CoClasses, which needs to be wrapped for inclusion into a C# project. My first attempt to call LoadLibrary on the wrapped dll failed; I must have not wrapped the dll correctly. Where is a good example of what needs to be accomplished for a wrapped C++ DLL to be used from within a C# project?
Thank you for your time.
March 18th, 2009, 10:06 AM
What do you actually have? Do you a simple native Win32 DLL or do you have COM DLL? If you have a COM dll you don't need to wrap it up before you can consume it within a C# project. If you are using Visual Studio you can you can right click on the project and select 'Add reference...'. One of the tabs allows you to pick COM objects. Under the hood it will create a runtime callable wrapper for you which you don't need to worry about. If you're not using Visual Studio you can use the Framework to generate the necessary plumbing for you (I don't know how exactly but I'm sure there are a few command line utilities to do that. After all that is what Visual Studio must be using under the hood). If it is standard C++ DLL this article should point you in the right direction...
I have a C++ DLL/IDL, comprised of several CoClasses, which needs to be wrapped for inclusion into a C# project
Click Here to Expand Forum to Full Width
This a Codeguru.com survey!