Hi.
I'v initially posted this into .NET Development / CLR, but here it seems to be more suitable, so I would like to repeat my question.
Well, I have implemented a couple of asynchronous pluggable protocols (in C#) for IE. They are registered as temporary namespace handlers and used with WebBrowser controls in my WinForms project. All works fine until WebBrowser.ShowPrintPreviewDialog() is called. Then, during next garbage collection (started by GC itself or invoked by GC.Collect()), the DisconnectedContext MDA is activated while debugging or, if application runs separately from debugger, there SEHExceptions or something like are thrown. Sometimes in this case an application can simply hang (stop responding on keyboard and mouse input) without any exceptions. So what is the workaround for that
The entry point method of an application is marked with STAThread attribute (otherwise WebBrowser control cannot be instantiated), and creation and usage of my objects that implement pluggable protocols proceed in the same thread, of course, the main (GUI) thread. But I'v noticed that Print Preview Dialog shown by ShowPrintPreviewDialog() uses its own thread and operates with my pluggable protocol handlers in that thread. Could it be the core of a problem, and if so, how can I fix that