Avoiding disconnected context warning when shutting down a thread on which STA COM objects have been created
问题 I am working on a COM API written in C++ with ATL, which clients will be expected to use in C# via it's COM interop facilities. Currently all the COM objects are only written to support the single threaded apartment model. Some of the functions of this API cause a separate worker thread to be spawned, which listens for events from a server. In response to events from the server this worker thread creates some fairly simple COM objects, and then passes these objects to a COM event. There are