Steema Issues Database

Note: This database is for bugs and wishes only. For technical support help, if you are a customer please visit our online forums;
otherwise you can use StackOverflow.
Before using this bug-tracker we recommend a look at this document, Steema Bug Fixing Policy.



Bug 390

Summary: [TA05016588] There's a customer who uses GDI in the Chart but GDI+ in his applicat...
Product: ActiveX TeeChart Reporter: yeray alonso <yeray>
Component: OthersAssignee: Steema Issue Manager <issuemanager>
Status: RESOLVED FIXED    
Severity: major CC: marc
Priority: Normal    
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: All   
Chart Series: --- Delphi / C++ Builder RAD IDE Version:

Description yeray alonso 2013-11-20 11:43:30 EST
There's a customer who uses GDI in the Chart but GDI+ in his application (VC++). And he founds in v2013.0.1.0 the application doesn't terminate when he has:
afx_msg void CMainFrame::OnDestroy()
{
  Gdiplus::GdiplusShutdown(m_GdiPlusToken);
}
But according to MSDN he should do it:
Do not call GdiplusStartup or GdiplusShutdown in DllMain or in any function that is called by DllMain. If you want to create a DLL that uses GDI+, you should use one of the following techniques to initialize GDI+:
Require your clients to call GdiplusStartup before they call the functions in your DLL and to call GdiplusShutdown when they have finished using your DLL.
Export your own startup function that calls GdiplusStartup and your own shutdown function that calls GdiplusShutdown. Require your clients to call your startup function before they call other functions in your DLL and to call your shutdown function when they have finished using your DLL.
Call GdiplusStartup and GdiplusShutdown in each of your functions that make GDI+ calls.
http://msdn.microsoft.com/en-us/library/windows/desktop/ms534077(v=vs.85).aspx
The customer attached an example application here:
http://www.teechart.net/support/viewtopic.php?f=1&t=14094&p=62012#p61975 [created:2013-06-06T10:02:08.000+01:00 reported by:yeray@steema.com reported in version:Version AX2013 Release 2013.0.1.1 (TeeChart ActiveX Control)]
Comment 1 marc meumann 2016-04-26 02:59:20 EDT
TeeChart now provides a method to shutdown GDIPlus. It doesn't provide an automatic solution for all situations where TeeChart is nested in an application that also controls use of GDIPlus but does provide a means, by code, to resolve incompatibilities.