CXTPResourceImage crashes application |
Post Reply |
Author | |
rdhd
Senior Member Joined: 13 August 2007 Location: United States Status: Offline Points: 886 |
Post Options
Thanks(0)
Posted: 21 February 2012 at 11:39am |
We have a number of MFC modules loaded into our app. Some of these are for active x controls and these DLLs can get unloaded at any time (say when the last object served by the DLL is released).
I have found that the
CXTPToolTipContext:: DrawBackground method does this:CXTPResourceImage* pImage = pImages->LoadFile(_T("TOOLTIPFRAME")); If the first tooltip to display comes from one of our ActiveX controls, the resource image CodeJock creates grabs and stores the module state data pointer of the ActiveX control. That would be fine except that the CXTPResourceImages (the pImages in the above call) is stored in static data in CodeJock. Once loaded, the image remains loaded. Later when we are shutting down and the command bars object (ribbon bar in the frame) is destroyed, the CodeJock code removes all the images. But this is occuring during shutdown and this is the frame so many of the DLLs loaded by the OS have already been unloaded. The result is that the image for the "TOOLTIPFRAME", which has stored a module state data pointer that is no longer in the process crashes the application.
Since CodeJock is loading its own image and storing it in static data until the frame is destroyed, should CodeJock not make sure it is the CodeJock (or the application's) module state data pointer being stored in the resource image object?
|
|
rdhd
Senior Member Joined: 13 August 2007 Location: United States Status: Offline Points: 886 |
Post Options
Thanks(0)
|
I was asked how I solved this problem. I locked and loaded our active X DLLs into the process. I don't unload them until our main DLL unloads from the process.
|
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |