Problem with COM with .NET Interop and Apartments

I've written a simple in-process COM library, with the coclass, the type library and the one interface present therein registered in the registry. The type library is embedded as a resource within the COM DLL.

I'm having problems using it in a couple of STA threads in .NET. I can import it and use it from the 1st (GUI) thread, but not the secondary thread. (Some QueryInterface / System.InvalidCastException error).

What is the best forum to elaborate on this problem? I'm not entirely sure whether the problem lies in my COM object or my usage of .NET.

Thanks

Daniel

[603 byte] By [DanielDeptford] at [2007-12-24]
# 1
Try the General forum of the language that you are using
DMan1 at 2007-8-31 > top of Msdn Tech,Feedback for forums and MSDN websites,Where Is the Forum For...?...
# 2

Well its both a C# and a C++ problem, but maybe neither. It might be a COM architecture problem. So that's why I asked :)

It could be that I'm inept at registering COM servers in the registry, that I'm not very good at writing COM servers in C++, or just plainly bad at using COM in .NET/C#. Since there's no COM forums (that I can see), and I think the server code is semantically good (in C++), I've decided to post in the CLR forum. I hope I made the right choice!

DanielDeptford at 2007-8-31 > top of Msdn Tech,Feedback for forums and MSDN websites,Where Is the Forum For...?...