I wrote a atl COM dll, dual. And used one of its intreace X in a C# GUI proj. when call X.F(), I got an System.InvalidCastException, can not cast namespace.XClass to namespace.IX, QueryInterface failed: BADTYPE. The call was in my own thread.
If i move the code to the GUI thread, it works just fine.
Please help me with that. Thanks a lot.