Instead of emailing it, could you upload it to ftp://ftp.ni.com/incoming/ and post here to let me know the name?
I think we're onto something with the threading. The CCWIMAQ object is an apartment threaded in-process COM server. This basically means that it expects to be called only by the thread that created it (really it expects to be called from the apartment that created it, but for our purposes this is equivalent to the thread that created it).
In order to call it from another thread, you need to marshal the COM pointer to the control from the thread that created it to the other thread. There are two ways to do this. You can use CoMarshalInterThreadInterfaceInStream or you can use
the Global Interface Table. Check out
this MSDN topic for information about this.
One thing I'm not sure of is exactly why the call from the worker thread succeeds and then the call from the creating thread fails. I'll need to check out your program to try to figure that out. Does the worker thread call CoInitialize or CoInitializeEx?
In the end, I suspect that you will not want to marshal the pointer to the other thread and instead will prefer to just post a message from the worker thread to the UI thread to make the call that checks the status of the trigger and then use an event or some other synchronization mechanism to cooridinate the communication of the status back to the worker thread. You could try always accessing the CCWIMAQ object from the main thread and see if you no longer get the exception.