Thread: debug assertion failure

  1. #1
    Registered User
    Join Date
    Oct 2002
    Posts
    69

    debug assertion failure

    i finally got my program up and running, but i get a debug assertion failure in one of my functions:

    Code:
    void CSignGUIDlg::OnSign() 
    {
    	m_Edit.GetWindowText(m_Get);          //fails on this line
    	m_Size = m_Edit.GetWindowTextLength();
    	m_Data = new BYTE[m_Size];
    	
    	for (int i = 0; i<m_Size; i++)
    	{
    		m_Data[i] = m_Get[i];
    	}
    }
    it fails when it makes the call to
    Code:
    ASSERT(::IsWindow(m_hWnd));
    in wincore.cpp

    i take it there's something that i'm doing wrong? m_Edit is defined as a CEdit type, and m_Get is a CString type. it fails all the time, whether i have text in my box or not.

  2. #2
    Registered User
    Join Date
    Jul 2003
    Posts
    59
    change DDX_Control(pDX, IDC_EDIT1, m_string);

    to

    DDX_Control(pDX, IDC_EDIT1, m_Edit);

    in

    signGUIDlg.cpp

  3. #3
    Registered User
    Join Date
    Oct 2002
    Posts
    69
    great! thanks!

    i suppose that's what i get for building my program using the class wizard and not keeping track of things like that

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. File I/O Assertion Failure in VS2008
    By clegs in forum C Programming
    Replies: 5
    Last Post: 12-25-2008, 04:47 AM
  2. Debug Assertion failure problem
    By uldaman in forum C++ Programming
    Replies: 8
    Last Post: 01-21-2008, 02:22 AM
  3. Debug Assertion Failure - bad pointer
    By ventolin in forum C++ Programming
    Replies: 5
    Last Post: 05-24-2004, 10:10 AM
  4. Debug Assertion Failure
    By gozlan in forum C Programming
    Replies: 2
    Last Post: 09-08-2002, 11:10 AM
  5. How to tackle a debug assertion failure?
    By juhigarg in forum C++ Programming
    Replies: 2
    Last Post: 11-12-2001, 12:59 PM