I managed to isolate the problem, and you should be able to reproduce it with Visual Studio:
1. Use MFC wizard to create new MDI app
2. Add CTChart and CTeeEditor to the View and create them as usual.
3. Add ID_FILE_CLOSE handler in MainFrm to call
Code: Select all
void CMainFrame::OnFileClose()
{
CoFreeUnusedLibraries();
}
Select File->close a couple of times and
Code: Select all
'SPTChartMDITest.exe' (Win32): Unloaded 'D:\SPTChart\x64\Debug\TeeChart201764.ocx'
Exception thrown at 0x0000000000540200 in SPTChartMDITest.exe: 0xC0000005: Access violation executing location 0x0000000000540200.