|
-
February 19th, 2009, 05:46 AM
#16
-
February 19th, 2009, 06:30 AM
#17
Re: Debug Assertion in occcont.cpp Line: 926
 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
-
February 19th, 2009, 06:56 AM
#18
Re: Debug Assertion in occcont.cpp Line: 926
 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"? 
And the third time:
 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).
Victor Nijegorodov
-
April 2nd, 2009, 08:42 AM
#19
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
-
April 2nd, 2009, 03:13 PM
#20
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.
Last edited by Televiper; April 2nd, 2009 at 03:25 PM.
-
April 2nd, 2009, 06:21 PM
#21
Re: Debug Assertion in occcont.cpp Line: 926
 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.
-
April 3rd, 2009, 10:52 AM
#22
Re: Debug Assertion in occcont.cpp Line: 926
 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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|