Article ID: 322909 - View products that this article applies to.
This article was previously published under Q322909
A DLL that is using the Active Template Library (ATL) CImage class may cause a deadlock when it is unloaded from a process or when the loading process shuts down.
This problem occurs because the CImage class initializes and then shuts down GDI+ by using the static nested class CInitGDIPlus. This class initializes GDI+ before any CImage function that requires GDI+ is called. GDI+ is shut down by calling GdiplusShutdown when the CInitGDIPlus class is destructed. CInitGDIPlus is a static class that is destructed in a DLL in the context of DllMain. The documentation states that you cannot call GdiplusShutdown in DllMain.
Service pack InformationTo resolve this problem, obtain the latest service pack for Microsoft Visual Studio .NET. For more information, click the following article number to view the article in the Microsoft Knowledge Base:
(http://support.microsoft.com/kb/837234/ )List of bugs that are fixed in Visual Studio .NET 2002 Service Pack 1
Hotfix informationFor more information about this hotfix, click the following article number to view the article in the Microsoft Knowledge Base:
(http://support.microsoft.com/kb/326459/ )COleDateTime comparison asserts or returns incorrect value
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section of this article. This problem was first corrected in Visual Studio .NET 2002 Service Pack 1.
Steps to Reproduce the Behavior
Article ID: 322909 - Last Review: September 27, 2005 - Revision: 7.1
Contact us for more help
Connect with Answer Desk for expert help.