R
Ricardo Silveira
There is any way to access a .net dll function (C#) from a C++ program?
Thanks.
Ricardo
Thanks.
Ricardo
dm_dal said:How about using COM Interop and creating a COM Callable Wrapper for the C#
dll. Then access it just as you would any other COM object from your C++
application.
David
There is any way to access a .net dll function (C#) from a C++ program?
Thanks.
Lasse Vågsæther Karlsen said:Creative round-tripping.
Basically:
1. run ildasm on the assembly to produce a set of resource files and a
disassembly in a .il file
2. fix up the .il file to include the necessary directives
3. run ilasm on the assembly file, rebuilding the assembly with the new
directives
There's an article about it here:
http://www.blong.com/Conferences/BorConUK2002/Interop1/Win32AndDotNetIntero
p.htm
See my other answer to this question. Exporting methods from an
assembly is a bad thing in the current version of the framework. It
will cause deadlocks, so don't do it. The only safe way is to use the
COM interop layer through the COM Callable Wrapper.
Richard
a bad thing in the current version of the framework. It will cause
deadlocks, so don't do it. The only safe way is to use the COM interop layer
through the COM Callable Wrapper.
<snip>Your statement assumes that everything does the exporting the same way
as Managed C++. Creative round tripping using Inverse P/Invoke does
not manufacture an exported DLL entry point, so far as I can tell. The
same is true with Delphi for .NET, which also supports unmanaged
exports by simple Inverse P/Invoke. I think the deadlock thing is a
Managed C++ specific issue due to the extra code generated when you
export a routine