Access Violation from dialog based app in AFX_DATA_INIT
Posted on 1998-06-04
This plain and simple (that was the original goal) dialog based application is suddently issuing an access violation when a CString is being initialized, in this code:
// CMyDlg dialog
CMyDlg::CMyDlg(CWnd* pParent /*=NULL*/)
: CDialog(CMyDlg::IDD, pParent)
m_myText = _T("");
// Note that LoadIcon does not require a subsequent DestroyIcon in Win32
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
It stops at CString::AllocBeforeWrite(int nLen) in Strcore.cpp. I also noticed that it does not call DoDataExchange(CDataExchange* pDX) or OnInitDialog() before it enters the above code and CString initialization.
The worst is that the application was working before this came up. No major change was made, except for adding edit boxes and the variables from ClassWizard itself.
Have you any ideas of what could be happening?