Call a managed DLL from a native VC++ EXE

  • Thread starter Thread starter JY
  • Start date Start date
J

JY

Hi,

I'm trying this sample exactly as mentioned in the link:

http://support.microsoft.com/default.aspx/kb/828736

In the client project even though I enable CLR support with the old syntax,
I get the following popup message error at runtime:

"An unhandled exception of type 'System.InvalidProgramException' occurred in
Unknown Module.

Additional information: Common Language Runtime detected an invalid program."

I'm using VS 2005 with SP1 installed.
Not sure what is wrong, appreciate any help.

TIA,
JY
 
I'm trying this sample exactly as mentioned in the link:

http://support.microsoft.com/default.aspx/kb/828736

In the client project even though I enable CLR support with the old syntax,

You do not need to enable CLR support in the client project. The whole
point of the exercise is to access a .NET component from a _pure
native_ C++ project, via COM interop!
I get the following popup message error at runtime:

"An unhandled exception of type 'System.InvalidProgramException' occurredin
Unknown Module.

Additional information: Common Language Runtime detected an invalid program."

What line are you getting this at? The one on which you first try to
create an instance of the managed class?
I'm using VS 2005 with SP1 installed.

For both the managed and the unmanaged projects?
 
Back
Top