"JJ" wrote:
> I'm trying to use a third party COM object in a DLL when the DLL is being
> loaded (i.e. at DLL_PROCESS_ATTACH stage).
Seems like a bad idea. Have you read the warnings for DllMain? You
can't use anything tha calls LoadLibrary.
This extract from an old MSDN:
"Warning On attach, the body of your DLL entry-point function should
perform only simple initialization tasks,
[...]
Calling functions other than TLS, object-creation, and file functions
may result in problems that are difficult to diagnose. For example,
calling User, Shell, COM, RPC, and Windows Sockets functions (or any
functions that call these functions) can cause access violation
errors, because their DLLs call LoadLibrary to load other system
components".
Note the mention of COM.