Vsisual Studio 2005: Assertions when opening a dialog loading OCX
Hello,
we get Assertions when opening a dialog loading OCX-Files as tabs.
The ocx are compiled with Visual Basic 6 in general.
Here is what I found out
The assertion is located in C:\Program Files\Microsoft Visual Studio
8\VC\atlmfc\src\mfc\occcont.cpp:
BOOL COleControlContainer::FillListSitesOrWnds(_AFX_OCC_DIALOG_INFO*
pOccDlgInfo)
{
2?
COleControlSiteOrWnd *pTemp =
new COleControlSiteOrWnd(
hwndCtrl,
pOccDlgInfo->m_pItemInfo[i].bAutoRadioButton);
ASSERT(IsWindow(pTemp->m_hWnd));
2?
}
This is the call stack:
mfc80d.dll!COleControlContainer::FillListSitesOrWnds(_AFX_OCC_DIALOG_INFO *
pOccDlgInfo=0x0012c85c) Line 926 + 0x23 bytes C++
mfc80d.dll!CWnd::InitControlContainer(int bCreateFromResource=0) Line 118 C++
mfc80d.dll!CWnd::CreateControl(const _GUID & clsid={...}, const
char * lpszWindowName=0x00000000, unsigned long dwStyle=1342177280, const
tagPOINT * ppt=0x0012ba74, const tagSIZE * psize=0x00000000, CWnd *
pParentWnd=0x0958b630, unsigned int nID=55103, CFile * pPersist=0x00000000,
int bStorage=0, wchar_t * bstrLicKey=0x00000000) Line 66 + 0x10 bytes C++
GeneralEditor.dll!GeActiveXContainer::OnCreate(tagCREATESTRUCTA
* lpCreateStruct=0x0012c1c8) Line 136 + 0x31 bytes C++
mfc80d.dll!CWnd::OnWndMsg(unsigned int message=1, unsigned int
wParam=0, long lParam=1229256, long * pResult=0x0012bf9c) Line 2000 + 0xd
bytes C++
GeneralEditor.dll!PaView<PaFormView>::OnWndMsg(unsigned int
message=1, unsigned int wParam=0, long lParam=1229256, long *
pResult=0x0012bf9c) Line 227 + 0x18 bytes C++
The Problem is that in MFC80D.dll the code of occcont.cpp has changed:
FillListSitesOrWnds is a
new function that was not part of earlier MFC dlls
InitControlContainer(int bCreateFromResource=0) got a parameter and if
false calls COleControlContainer::FillListSitesOrWnds
CWnd::CreateControl calls
InitControlContainer always with (false)
Stepping over the call of COleControlContainer::FillListSitesOrWnds opens
the properties-window with full functionality and without assertion.
Searching in internet I found this thread, where a solution is proposed but
does not work perfectly and a case of ID SRX060112603946 is opened at
Microsoft support:
http://groups.google.co.uk/group/microsoft.public.vc.mfcole/browse_thread/thread/98db405d27db644e/2d59dfbe17771f1f?lnk=st&q=Difference+in+generated+wrappers+for+OCXs+in+vs2003+and+vs2005&rnum=1&hl=en
My questions are:
1) Does the code change in MCF80D.dll change the bahaviour of our dialogs?
Or in other words can we ignore this Assertion because it is no significant
change of behaviour and not dangerous?
2) How can we change our Code to avoid that assertion in a secure way? The
suggestion I found did not work in that case.
Thanks
Jutta