Hi there,

> I can't find any references to the ability to call a legacy DLL that
> exports a standard C++ object API.
>
> Assume you have a legacy .DLL that exports some good old fashion C++
> classes, so it has a true C++ object API, not just a C API.  Assume
> further that this .DLL does not have a COM interface.
>
> Can the objects in this .DLL be used by a .NET assembly (managed C++ or
> other language)?  If it had a COM interface, it would be trivial.  If it

It seems that one way to achieve what you are trying to do would be to
introduce another level of indirection in the form of a shim DLL that
exports just functions.  Then, you could manage some sort of
cookie/C++-object mapping thing inside of it.

I'm thinking something like a CreateHuhHuhObject() that returns a cookie.
And, then suppose the real object had a Foo() method, you could create a
Foo() function that takes as its first parameter the cookie you got back
from CreateHuhHuhObject().

It just seems that this would be the clear way to do this.  You may be
able to parse up and figure out the name mangling of the exports coming
out of the DLL with the exported C++ object in it.  But, that may be a
bigger chore. ;-)

That's all that pops into my mind.

   -T

Reply via email to