Chris Yager
8/11/2007 6:52:00 PM
I have a service that accesses a VB6 COM component on a timer event. On
64-bit windows (running in 32-bit "mode") the process fails if it is run in
a secondary thread but works fine when run on the main thread. This
behavior cannot be re-produced in 32-bit environment.
Any help would be greatly appreciated.
The error is:
System.InvalidCastException: Unable to cast COM object of type 'blah.type'
to interface type 'blah.interfacetype'. This operation failed because the
QueryInterface call on the COM component for the interface with IID
'{[guid....]]}' failed due to the following error: Error loading type
library/DLL. (Exception frm HRESULT: 0x80029C4A (TYPE_E_CANTLOADLIBRARY)).
The exact code from the same components runs fine in 64-bit environment
(again running in 32-bit mode) if it is not run on a secondary thread.
I'm not using a primary interop assembly and nothing is running from the GAC
except framework stuff.
thanks,
-chris