CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 2 of 2 FirstFirst 12
Results 16 to 22 of 22
  1. #16
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,430

    Re: Debug Assertion in occcont.cpp Line: 926

    You still haven't answered my questions. Why?

    Quote Originally Posted by dr.dran View Post
    The joke is that if I compile for release the program compile wiwhout an error... grrrrrr
    Why "grrrrrr"?
    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.
    Victor Nijegorodov

  2. #17
    Join Date
    Feb 2009
    Posts
    5

    Re: Debug Assertion in occcont.cpp Line: 926

    Quote Originally Posted by VictorN View Post
    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

  3. #18
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,430

    Re: Debug Assertion in occcont.cpp Line: 926

    Quote Originally Posted by dr.dran View Post
    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:
    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).
    Victor Nijegorodov

  4. #19
    Join Date
    Apr 2009
    Location
    Waterloo, Ont
    Posts
    2

    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

  5. #20
    Join Date
    Apr 2009
    Location
    Waterloo, Ont
    Posts
    2

    Smile 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.

  6. #21
    Join Date
    May 2007
    Posts
    811

    Re: Debug Assertion in occcont.cpp Line: 926

    Quote Originally Posted by Televiper View Post
    I created a Release version to circumvent the assertion fault...
    Fantastic, I'm going to have to introduce this great idea at my work.

  7. #22
    Join Date
    Apr 1999
    Posts
    27,449

    Re: Debug Assertion in occcont.cpp Line: 926

    Quote Originally Posted by STLDude View Post
    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

Page 2 of 2 FirstFirst 12

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured