C# Interop

A

Al Pennyworth

I created a dll in .NET using C# and I need to call this dll from a
Visual C++ 6.0 application. I am programmatically calling the regasm.exe
as I am getting the installroot registry key, finding the folder, get
the exe, then doing a CreateProcess and it seems to function correctly.

My problem is in the call to the C# dll, after a couple of times, it
seems to GPF but the c++ 6.0 application continues to run w/o any
problems. I can continue to hit the button, launch the C# dll, when it
returns, it gets another GPF and the cycle goes on.

Here is a basic outline of my 6.0 c++ function:

void functionname
{
// Initialize COM.
HRESULT hr = CoInitialize(NULL);

// Create the interface pointer.
IManageInterfacePtr pIInterface(__uuidof(ManagerInterface));

// Call the Add method.
pIInterface->LaunchRSSDLL(string, string, string);

pIInterface->Dispose(); <--this is from trying something with the C# dll

pIInterface->Release();

// Uninitialize COM.
CoUninitialize();
}

I have put try/catch inside this function, around the call to this
function, inside my C# DLL COM interface, and I still cannot find where
the gpf is occurring. This is my first C# dll so be please be patient if
I so kind of idiotic in describing this. Any ideas on what I may be
missing? Any ideas on what I can look at? I have run out of ideas.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top