简体   繁体   中英

SEHException occurs while calling a COM method from C#

I am calling a COM method from c# using interop. First COM call is from a thread and it executed correctly. After that I call another COM method from the main thread. Then an SEHException with the message "external component has thrown an exception" is coming. My COM is STA supported.There is no issue when I tried to call both methods from the same thread. I think that marshalling will not happening in this case. What can I do for this?

I have created all COM objects in a class and shared it among the threads. Then it worked successfully.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM