Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

 
 
Thread Tools Display Modes
Prev Previous Post in Thread   Next Post in Thread Next
Old Nov 11th, 2004, 12:11 PM   #1
BruceLeroy
Newbie
 
Join Date: Nov 2004
Posts: 18
Rep Power: 0 BruceLeroy is on a distinguished road
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.
BruceLeroy is offline   Reply With Quote
 

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 9:51 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC