Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. debug version crashes on base Create();

debug version crashes on base Create();

Scheduled Pinned Locked Moved C / C++ / MFC
announcementc++debugginghelpquestion
3 Posts 1 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    nss
    wrote on last edited by
    #1

    The release exe works fine. The debug is crashing at the calll to CDialog Create()

    BOOL CDisplayInfoList::Create(UINT nID, CWnd *pWnd, const CString* keys, int keysSize, std::set* pKeySet)
    {

    m\_pParentWnd =  pWnd;
    
    m\_pKeySet = pKeySet;
    
    m\_allKeysArray = new CString \[keysSize\];
    
    m\_arraySize = keysSize;
    
    for (int i =0; i < keysSize; i++)
    {
    	m\_allKeysArray\[i\] = keys\[i\];
    }
    `return CDialog::Create( nID,pWnd);`
    

    }

    Its just a popup resizing dialog with a clistctrl and two buttons. What shall I suspect? THe call is :

    CDisplayInfoList\* pDisplayInfoList = new CDisplayInfoList;
    
    if (pDisplayInfoList == NULL) return;
    
    `BOOL ret = pDisplayInfoList->Create(IDD_DISPLAYINFOLIST, this, goodFields, flds.size() ,&(pDoc->m_keySet));`	if(!ret)  //Create failed.
    {
    	AfxMessageBox("Error creating viewbox");
    
    	delete pDisplayInfoList;
    
    	return;
    }
    

    winocc.cpp line 259, where its saying its not IsWindow:

    int CWnd::GetDlgCtrlID() const
    {
    ASSERT(::IsWindow(m_hWnd));

    N 2 Replies Last reply
    0
    • N nss

      The release exe works fine. The debug is crashing at the calll to CDialog Create()

      BOOL CDisplayInfoList::Create(UINT nID, CWnd *pWnd, const CString* keys, int keysSize, std::set* pKeySet)
      {

      m\_pParentWnd =  pWnd;
      
      m\_pKeySet = pKeySet;
      
      m\_allKeysArray = new CString \[keysSize\];
      
      m\_arraySize = keysSize;
      
      for (int i =0; i < keysSize; i++)
      {
      	m\_allKeysArray\[i\] = keys\[i\];
      }
      `return CDialog::Create( nID,pWnd);`
      

      }

      Its just a popup resizing dialog with a clistctrl and two buttons. What shall I suspect? THe call is :

      CDisplayInfoList\* pDisplayInfoList = new CDisplayInfoList;
      
      if (pDisplayInfoList == NULL) return;
      
      `BOOL ret = pDisplayInfoList->Create(IDD_DISPLAYINFOLIST, this, goodFields, flds.size() ,&(pDoc->m_keySet));`	if(!ret)  //Create failed.
      {
      	AfxMessageBox("Error creating viewbox");
      
      	delete pDisplayInfoList;
      
      	return;
      }
      

      winocc.cpp line 259, where its saying its not IsWindow:

      int CWnd::GetDlgCtrlID() const
      {
      ASSERT(::IsWindow(m_hWnd));

      N Offline
      N Offline
      nss
      wrote on last edited by
      #2

      sorry its line 279...in

      void CWnd::MoveWindow(int x, int y, int nWidth, int nHeight, BOOL bRepaint)
      {
      ASSERT(::IsWindow(m_hWnd));

      if (m\_pCtrlSite == NULL)
      	::MoveWindow(m\_hWnd, x, y, nWidth, nHeight, bRepaint);
      else
      	m\_pCtrlSite->MoveWindow(x, y, nWidth, nHeight, bRepaint);
      

      }

      and stops in this if I set a breakpoint in it....

      1 Reply Last reply
      0
      • N nss

        The release exe works fine. The debug is crashing at the calll to CDialog Create()

        BOOL CDisplayInfoList::Create(UINT nID, CWnd *pWnd, const CString* keys, int keysSize, std::set* pKeySet)
        {

        m\_pParentWnd =  pWnd;
        
        m\_pKeySet = pKeySet;
        
        m\_allKeysArray = new CString \[keysSize\];
        
        m\_arraySize = keysSize;
        
        for (int i =0; i < keysSize; i++)
        {
        	m\_allKeysArray\[i\] = keys\[i\];
        }
        `return CDialog::Create( nID,pWnd);`
        

        }

        Its just a popup resizing dialog with a clistctrl and two buttons. What shall I suspect? THe call is :

        CDisplayInfoList\* pDisplayInfoList = new CDisplayInfoList;
        
        if (pDisplayInfoList == NULL) return;
        
        `BOOL ret = pDisplayInfoList->Create(IDD_DISPLAYINFOLIST, this, goodFields, flds.size() ,&(pDoc->m_keySet));`	if(!ret)  //Create failed.
        {
        	AfxMessageBox("Error creating viewbox");
        
        	delete pDisplayInfoList;
        
        	return;
        }
        

        winocc.cpp line 259, where its saying its not IsWindow:

        int CWnd::GetDlgCtrlID() const
        {
        ASSERT(::IsWindow(m_hWnd));

        N Offline
        N Offline
        nss
        wrote on last edited by
        #3

        I made a new identical class but named its resource and classname shorter. One of the two factors (maybe both) made the debug version happy too. I didnt realize there was a limit to the length of the names????

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups