Our application creates many (many many) charts in memory, not intended for screen display. These charts create CChartViewers for purposes unrelated to screen display. Creating many CChartViewers calls m_ToolTip.Create() on many CToolTipCtrl objects, which uses up many GDI objects. GDI objects are a finite resource, and creating too many of them can cause the application or Windows itself to have display bugs or crash.
I suggest that in the your Windows sources for CChartViewer, you delay calling m_ToolTip.Create() until you know that CChartViewer is actually being displayed on the screen.
If you are not using the GUI features of CChartViewer (eg. mouse event handling), note that many of the CChartViewer features are available in ViewPortManager and ImageMapHandler as well.
The ViewPortManager and ImageMapHandler are the non-GUI specific part of the chart viewer. The MFC CChartViewer and Qt QChartViewer implement the GUI specific part of the chart viewer and use ViewPortManager and ImageMapHandler to keep track of the viewport and hotspots. One of our customers even ported the chart viewer to another GUI framework wxWidgets.
the CToolTipCtrl works by listening to mouse events. It pops up a tooltip box if the mouse moves then stops for a while. It will hide the tooltip box if the mouse stops for too long. This means the CToolTipCtrl needs to exist so it can listen to the mouse events while the mouse is still moving, before it knows if it needs to display any tooltip.
If we modify the code so that the CToolTipCtrl is created when the CChartViewer first receives a mouse move message, would it work for your case? (Would your CChartViewer receives mouse message?)