When you use the standard "Windows" file open dialog with GetOpenFileName (), the shell will load the various DLLs needed to display a list of files, including user-defined ones.
In my application, I found that the DLL used by TortoiseCVS to draw overlays on the icons called GdiPlusShutdown (), and so some time after the "open file" dialog box appears, the TortoiseCVS DLL will be unloaded, it will close down GDI +, and mine graphic functions will fail!
It seems pretty bad that in any case, any old DLL can be loaded by my application at any time and start doing random things in its state. The workaround in my case was pretty simple - just restart GDI + if I find that it is disabled. However, if this happened on a client machine, where I could not debug it, it would be much harder to figure out what was happening.
Can someone give an idea? What can I do to prevent this from happening?
source share