Dll tutorial for Visual Studio 2005 - page 2

 

You could create a wrapper.

In visual studio Build a win32 dll in c++ that calls your managed code.

You would need follow these rough steps in the c++ wrapper:

1) to get a pointer to the runtime host calling CorBindToRuntimeEx().

2) then call start on it

3) retrieve the app domain from the host with GetDefaultDomain()

4) Create an instance of the assembly you want to call with CreateInstance() on the app domain

5)Create your dispatch interface

6) call invoke on the dispatch object

7) stop the runtime host

I am not sure if this is the most efficient way, but it will work.

bwilhite:
I tried adding the .def file to the .dll and that didn't work. I've only tried this in Visual Studio so far. I haven't tried it with mingw yet. I'd really like to be able to cross the managed code to unamanaged code boundary, though. BW
 

Hi all

I am only a novice .net dev but would this help - Simplified Wrapper and Interface Generator

Reason: