Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I have a native C++ (not COM) DLL that has classes in it. I would like to call it from csharp - create class objects, and invoke functions. What is the best way of approaching this. I donot have access to the source, all i have is the .h files and the dlls. I am not really very familiar with P/Invoke - is that the only option?

 

Thanks in advance!

Linesh

  • Administrators
Posted

Unfortunately P/Invoke is about the only option and not likely to be an easy one at that. Depending on how the classes have been exported from the DLL the actual method names could have been 'mangled', in this case you would need to use a tool like dumpbin.exe to get the actual exported method names to call.

 

Depending on the situation in might be easier to create a .Net wrapper in managed C++ and call the wrapper from .Net.

Posting Guidelines FAQ Post Formatting

 

Intellectuals solve problems; geniuses prevent them.

-- Albert Einstein

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...