Re: Debug Assertion in occcont.cpp Line: 926
You still haven't answered my questions. Why? :confused:
Quote:
Originally Posted by
dr.dran
The joke is that if I compile for release the program compile wiwhout an error... grrrrrr
Why "grrrrrr"? :confused:
It is a standard behavior! ASSERT macro is ignored (it is designed to be ignored) in the Release build. Therefore you don't see any message box, although the same problem (as displayed in the message box in debug build) still exists.
Re: Debug Assertion in occcont.cpp Line: 926
Quote:
Originally Posted by
VictorN
But you wrote in your OP it was in occcont.cpp:
So WHERE is the ASSERT statement that failed? What is the statement asserted? What are any comments around this ASSERT?
What does the GetClsid() return?
What are the values of other parameters passed in CreateControl?
Thi is the value passed to the Create Control:
bStorage 0 int
bstrLicKey 0x00000000 <Bad Ptr> wchar_t *
dwStyle 268500992 unsigned long
lpszWindowName 0x004c1bfd "" const char *
nID 1704 unsigned int
pParentWnd 0x01c3dff0 {CXProgView hWnd=0x000a0722} CWnd *
pPersist 0x00000000 {hFile=??? name=???} CFile *
rect {top=218 bottom=22 left=149 right=246} const tag
There isn't any comment in the assert statement...
Best regards
Franco Tampieri
Re: Debug Assertion in occcont.cpp Line: 926
Quote:
Originally Posted by
dr.dran
Thi is the value passed to the Create Control:
bStorage 0 int
bstrLicKey 0x00000000 <Bad Ptr> wchar_t *
dwStyle 268500992 unsigned long
lpszWindowName 0x004c1bfd "" const char *
nID 1704 unsigned int
pParentWnd 0x01c3dff0 {CXProgView hWnd=0x000a0722} CWnd *
pPersist 0x00000000 {hFile=??? name=???} CFile *
rect {top=218 bottom=22 left=149 right=246} const tag
There isn't any comment in the assert statement...
Best regards
Franco Tampieri
What is "Create Control"? :confused:
And the third time:
Quote:
Originally Posted by Victor
WHERE is the ASSERT statement that failed? What is the statement asserted?
Note, that I don't have VS2005 installed (only VS2008 and VS6) so I hove no idea what the code around this ASSERT is. Please, post it (don't forget to use Code tags around the code snippet).
Anyway, the problem seems to be the non-correct CLSID of your control (see CreateControl documentation).
Re: Debug Assertion in occcont.cpp Line: 926
I've been having a similar problem. A project originally working in Visual C++ 6 has been converted to Visual Studio 2005, and I receive the assertion fault when opening an Active-X instrument attached to a dialog box. Would love to upgrade to Visual Studio 2008 but I'm stuck with an older version of National Instruments Measurement Studio.
This is the segment from "occont.cpp" *Edit... the failing Assert statement is the last statement in this code chunk.
Code:
//First time start searching from first z-order, else
//search from 1 after the previous window.
HWND hwndSearchFrom= (hwndStart == NULL) ?
GetWindow(m_pWnd->GetSafeHwnd(),GW_CHILD) :
::GetWindow(hwndStart,GW_HWNDNEXT);
HWND hwndCtrl=AfxGetDlgItemStartFromHWND(pOccDlgInfo->m_pItemInfo[i].nId, hwndSearchFrom);
//If not found, revert to prev method of GetDlgItem, this means Win32 children list and
//resource item array are out of sync
if (hwndCtrl == NULL)
{
hwndCtrl = ::GetDlgItem(m_pWnd->GetSafeHwnd(),pOccDlgInfo->m_pItemInfo[i].nId);
TRACE(traceAppMsg, 0, "Warning: Resource items and Win32 Z-order lists are out of sync. Tab order may be not defined well.\n");
}
COleControlSiteOrWnd *pTemp =
new COleControlSiteOrWnd(
hwndCtrl,
pOccDlgInfo->m_pItemInfo[i].bAutoRadioButton);
ASSERT(IsWindow(pTemp->m_hWnd));
This is the calling code. The failure occurs at "pPanel->Create(IDD_DIGITAL_CONTROL, &parent);
Code:
bool DigitalOutput::VirtCreatePanel(CWnd & parent, CRect const & rc, CExcel *Excel, int row)
{
bool current = MB[varName]->IsSet(bit);
pPanel = new CDigitalControl(signal,this, current, &parent);
if(!IsWindow(parent.GetSafeHwnd()))
return false;
pPanel->Create(IDD_DIGITAL_CONTROL,&parent);
pPanel->MoveWindow(&rc);
pPanel->ShowWindow(SW_SHOW);
return true;
}
This is the line called from afxwin2.inl
Code:
// CDialog
_AFXWIN_INLINE BOOL CDialog::Create(UINT nIDTemplate, CWnd* pParentWnd)
{ return CDialog::Create(ATL_MAKEINTRESOURCE(nIDTemplate), pParentWnd); }
Thank you in advance for any assistance you can provide.
Andrew
Re: Debug Assertion in occcont.cpp Line: 926
Fixed the problem here.
Changed the InitATL() to AfxOleInit()
Code:
//Under the applications ::InitInstance()
// if (!InitATL())
// return FALSE;
if (!AfxOleInit())
return FALSE;
Additional Information:
I created a Release version to circumvent the assertion fault, and the actual instrument image would not show up on my dialogue box.
Re: Debug Assertion in occcont.cpp Line: 926
Quote:
Originally Posted by
Televiper
I created a Release version to circumvent the assertion fault...
Fantastic, I'm going to have to introduce this great idea at my work.
Re: Debug Assertion in occcont.cpp Line: 926
Quote:
Originally Posted by
STLDude
Fantastic, I'm going to have to introduce this great idea at my work.
If after doing that, you need a job, I think we may have a couple of openings.
Regards,
Paul McKenzie