Hi,
I have a problem with the ECompositeViewer Control. When I create the ECompositeViewer, attach it to the control and destroy the control, then my application doesn't release the GDI handles. I've tried it with a simple MFC application which does only instantiate and destroy the ECompositeViewer. Here is an example how I do it.
void CMapViewerMFCDlg::OnBnClickedButtonCreate()
{
CWnd *pWnd = GetDlgItem(IDC_STATIC_PlaceHolder);
CRect rcControl;
pWnd->GetClientRect(rcControl);
pWnd->MapWindowPoints(this, rcControl);
CLSID clsidControl;
VERIFY( SUCCEEDED(::CLSIDFromString(_T("{2D65BB9F-FB1B-444D-AC3A-CD7070147CC7}"), &clsidControl)));
VERIFY( m_Control.CreateControl(clsidControl, _T("Test"), WS_VISIBLE, rcControl, this, 99) );
m_Control.ShowWindow(SW_SHOW);
}
void CMapViewerMFCDlg::OnBnClickedButton2Delete()
{
if (::IsWindow(m_Control.GetSafeHwnd()))
{
COleControlSite* pSite = GetOleControlSite(99);
pSite->DestroyControl();
m_Control.DestroyWindow();
::CoFreeUnusedLibrariesEx(0,0);
}
}
Is it a known issue or do I something wrong?