03-05-2007 03:04 PM
03-06-2007 10:10 AM
Calling CoInitialize(NULL) before the call to niFgen_init() will solve the problem.
The issue is caused by the fact that the niFgen uses the IVI Configuration Server C API which is a C wrapper over a COM component. By default, the C API initializes COM for every thread in MTA (apartment) mode. It appears that ShellExecute attempts to initialize COM in STA mode (which will fail) but it does not check to see if the thread has already been initialized with a different threading model and take appropriate action. We will report this bug to Microsoft.
Best regards.
03-06-2007 10:30 AM
03-06-2007 10:51 AM
03-06-2007 12:34 PM