G
Guest
Here's my situation, I am moving some of my apps over from native C++
(primarily Win32 and MFC).
One of these apps uses some COM objects in worker threads running in the
background where it doesn't bother the user.
I'm keeping the native code that interfaces with the COM objects in a DLL
since I know it works with no problem (I've used for a year and half with no
bugs).
I want my .Net app to use those exported functions (from the above mentioned
DLL) from within child threads.
The problem I'm getting is that when my native code calls CoCreateInstance()
to get the interface, it returns E_NOINTERFACE. But only if my native code
is being called from within a child thread. I've tried just simply calling
it from a button push on a form, and it works perfectly.
Is there some kind of setting I need to set in the Thread object? I've
tried changing the apartment to MTA (from the defaul unknown). Is there some
other setting I'm missing?
thank you so much in advance,
ed
(primarily Win32 and MFC).
One of these apps uses some COM objects in worker threads running in the
background where it doesn't bother the user.
I'm keeping the native code that interfaces with the COM objects in a DLL
since I know it works with no problem (I've used for a year and half with no
bugs).
I want my .Net app to use those exported functions (from the above mentioned
DLL) from within child threads.
The problem I'm getting is that when my native code calls CoCreateInstance()
to get the interface, it returns E_NOINTERFACE. But only if my native code
is being called from within a child thread. I've tried just simply calling
it from a button push on a form, and it works perfectly.
Is there some kind of setting I need to set in the Thread object? I've
tried changing the apartment to MTA (from the defaul unknown). Is there some
other setting I'm missing?
thank you so much in advance,
ed