i had a simple windowed app going. it was working fine until i made a menu resource and tried to add it to the window -- the program ended early with some dialog to do with debug assertion failure or whatnot.
#include <afxwin.h>
#include "resource.h"
class SoundBlade : public CWinApp
{
public:
virtual BOOL InitInstance();
};
class CMainFrame : public CFrameWnd
{
public:
CMainFrame();
protected:
/* message that deals with creation of the window */
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
DECLARE_MESSAGE_MAP()
};
CMainFrame::CMainFrame()
{
Create(NULL, "Resources Fundamentals", WS_OVERLAPPEDWINDOW,
CRect(200, 120, 640, 400), NULL,
MAKEINTRESOURCE(IDR_MENU1));
}
/* A table of messages will be enumerated between the following two macros. */
BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd)
ON_WM_CREATE()
END_MESSAGE_MAP()
/* deal with specific messages here */
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
// Call the base class to create the window
if( CFrameWnd::OnCreate(lpCreateStruct) == 0) return 0;
// Otherwise, return -1
return -1;
}
BOOL SoundBlade::InitInstance()
{
m_pMainWnd = new CMainFrame; //get a frame/window object
m_pMainWnd->ShowWindow(SW_NORMAL); //show the window
return TRUE;
}
SoundBlade theApp;
i changed the code in the constructor, it was originally
Create(NULL, "Resources Fundamentals", WS_OVERLAPPEDWINDOW,
CRect(200, 120, 640, 400), NULL);
in other words all i have tried to do is add a menu. this one change forces the program to somehow show me a "Debug assertion failed" dialog with Ignore, Retry and Abort buttons. After I press anyone of those, I'm given a debug dialog. When I click that I'm sent into some heavy looking Microsoft code that I don't think I should mess with.
some more info, hopefully it'll offer some insight
Loaded 'C:\WINDOWS\SYSTEM\USER32.DLL', no matching symbolic information found.
Loaded 'C:\WINDOWS\SYSTEM\ADVAPI32.DLL', no matching symbolic information found.
Loaded 'C:\WINDOWS\SYSTEM\GDI32.DLL', no matching symbolic information found.
Loaded 'C:\WINDOWS\SYSTEM\KERNEL32.DLL', no matching symbolic information found.
Loaded symbols for 'C:\WINDOWS\SYSTEM\MSVCRTD.DLL'
Loaded symbols for 'C:\WINDOWS\SYSTEM\MFC42D.DLL'
Loaded 'C:\Program Files\AIM95\idlemon.dll', no matching symbolic information found.
Loaded 'C:\Program Files\WinPortrait\winphook.dll', no matching symbolic information found.
Warning: failed to load menu for CFrameWnd.