Re: COM interface function calling problem using different thread
Please guide where I am doing mistake? why marshaling problem is
coming? what I do to fix this problem?
You cannot use COM object from arbitrary thread without special
preparations. It seems that you need to do some basic reading
about COM threading and apartments. Get yourself a good COM
textbook. At least, read relevant MSDN sections:
"Processes, Threads, and Apartments"
Basically, you need to initialize COM system within each thread
where you're planning to use COM objects with `CoInitialize[Ex]'
call and then marshall COM interfaces across apartments before you
may make any method call. Probably the Global Interface Table
(GIT) will be good solution for singleton COM object:
"Accessing Interfaces Across Apartments"
I placed try-catch block around COM function but application is
not catching exception in catch block but vs2k5 open
"googleearth.tli" file. why my application is not catching
You should show relevant code snippet. It is impossible to tell
without seeing it. Ensure that `catch' clause catches correct
"googleearth.tli" file code
if (FAILED(_hr)) _com_issue_errorex(_hr, this,
my application is not catching exception cause of no throw
statement on library. right?
No, `_com_issue_errorex' constructor throws `_com_error'