tags:

views:

22

answers:

1

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

A: 

Nevermind, I think I just figured it out on my own. It looks like the Interop DLL and the third DLL referenced by the interop need to be located in the same directory.