.NET COM Interop with references to other libraries
Posted
by user262190
on Stack Overflow
See other posts from Stack Overflow
or by user262190
Published on 2010-02-01T15:19:39Z
Indexed on
2010/03/21
21:01 UTC
Read the original article
Hit count: 640
com
Hello,I'm up against a problem when loading a class in a managed library from a COM Interop library.
basically I have some Unmanaged C++ code and a COM Interop library written in C#. And finally a 3rd library which is referenced by the COM Interop library which contains a class:
public class MyClass{
public MyClass(){}
}
What I'd like to do is from my unmanaged c++ code, call a function in the Interop library The C++ code doesn't need to know of the existence of the third library, it's only used within the Interop. Init(){ MyClass _class = new MyClass(); }
for some reason this line in Init fails "MyClass _class = new MyClass();", and I don't get very usefull error messages, all I have to go on is a few of these in my output window: "First-chance exception at 0x7c812afb in DotNet_Com_Call.exe: Microsoft C++ exception: [rethrow] at memory location 0x00000000.."
and the HRESULT of the "HRESULT hr = pDotNetCOMPtr->Init();" line in my C++ code is "The system cannot find the specified file"
I'm new to COM so if anyone has any ideas or pointer to get me going the right direction, I'd appreciate it,
Thanks
© Stack Overflow or respective owner