Calling C# .net 1.1 com object from C++, MFC app

G

Guest

I have a C++, MFC app running on VStudio 6.
I have a C#, .net 1.1 dll written in VStudio 2003.

I have never had a problem with the C++ app calling the C# dll as a com
object before, but recently I changed something, I don't know what, and I
have started getting the following message when I try to open a form in the
C# com object that has an active x control on it.

Any ideas how I can fix this problem?

ActiveX control '78cc97a3-46b6-11cf-938d-dc09d442c235' cannot be
instantiated because the current thread is not in a single-threaded apartment.


Thanks,

Phil
 
N

Nicholas Paldino [.NET/C# MVP]

Phil,

Well, what did you change? It looks to me that you didn't initialize
the COM apartment correctly on the thread that is trying to make a call to
create your active x control (if your active x control is a .NET control by
the way, this scenario is not supported, however, if it is a regular COM
object (and the error text is wrong), then that is ok).
 

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