Click here to Skip to main content
15,905,316 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Why is Visual before Visual C++? Pin
Sam Hobbs12-Dec-06 16:15
Sam Hobbs12-Dec-06 16:15 
GeneralRe: Why is Visual before Visual C++? Pin
Code232613-Dec-06 11:00
Code232613-Dec-06 11:00 
AnswerRe: Why is Visual before Visual C++? Pin
Sam Hobbs12-Dec-06 16:17
Sam Hobbs12-Dec-06 16:17 
QuestionAntother SQL db implementation question Pin
Jim Crafton11-Dec-06 11:15
Jim Crafton11-Dec-06 11:15 
AnswerRe: Antother SQL db implementation question Pin
cmk11-Dec-06 11:48
cmk11-Dec-06 11:48 
GeneralRe: Antother SQL db implementation question Pin
Jim Crafton11-Dec-06 17:11
Jim Crafton11-Dec-06 17:11 
GeneralRe: Antother SQL db implementation question Pin
cmk11-Dec-06 20:45
cmk11-Dec-06 20:45 
QuestionStaring with a Dialog Pin
manustone11-Dec-06 10:49
manustone11-Dec-06 10:49 
Hi All
I need to start my MFC application with a window derived from CDialog
but I've got an exception.
Below the code I used.
What do I need to add to the Dialog class to let it be displayed?
I'm not using any .rc file and I want to built the dialog via code.
Thank you
manustone

<br />
<br />
//// GuiTestDlg.h<br />
<br />
class CGuiTestDlg : public CDialog<br />
{<br />
public:<br />
	CGuiTestDlg(CWnd* pWnd);<br />
	virtual ~CGuiTestDlg();<br />
<br />
	virtual BOOL OnInitDialog();<br />
<br />
	DECLARE_MESSAGE_MAP()<br />
};<br />
<br />
//// GuiTestDlg.cpp<br />
<br />
BEGIN_MESSAGE_MAP( CGuiTestDlg,CDialog )<br />
END_MESSAGE_MAP()<br />
<br />
CGuiTestDlg::CGuiTestDlg(CWnd* pWnd)<br />
: CDialog( ID_GUI_TEST_DLG, pWnd )<br />
{		<br />
}<br />
<br />
CGuiTestDlg::~CGuiTestDlg()<br />
{}<br />
<br />
BOOL CGuiTestDlg::OnInitDialog()<br />
{<br />
	CDialog::OnInitDialog();<br />
	return FALSE;<br />
}<br />
<br />
///////////<br />
<br />
///GuiTestApp.h<br />
<br />
class CGuiTestApp : public CWinApp<br />
{<br />
public:<br />
	CGuiTestApp( LPCTSTR lpszAppName );<br />
	virtual ~CGuiTestApp();<br />
	virtual BOOL InitInstance();<br />
};<br />
<br />
extern CGuiTestApp theApp;<br />
<br />
///GuiTestApp.cpp<br />
<br />
CGuiTestApp theApp( "Gui Test Application" );<br />
<br />
CGuiTestApp::CGuiTestApp( LPCTSTR lpszAppName )<br />
: CWinApp( lpszAppName )<br />
{	<br />
}<br />
<br />
BOOL CGuiTestApp::InitInstance()<br />
{<br />
	CWinApp::InitInstance();<br />
<br />
	CGuiTestDlg dlg(NULL);<br />
	m_pMainWnd = &dlg;<br />
	INT_PTR nResponse = dlg.DoModal();<br />
<br />
	if (nResponse == IDOK)<br />
	{<br />
		// TODO: Place code here to handle when the dialog is<br />
		//  dismissed with OK<br />
	}<br />
	else if (nResponse == IDCANCEL)<br />
	{<br />
		// TODO: Place code here to handle when the dialog is<br />
		//  dismissed with Cancel<br />
	}<br />
	<br />
	return FALSE;<br />
}<br />
<br />
CGuiTestApp::~CGuiTestApp()<br />
{}<br />
<br />

AnswerRe: Staring with a Dialog Pin
Michael Dunn11-Dec-06 10:55
sitebuilderMichael Dunn11-Dec-06 10:55 
GeneralRe: Staring with a Dialog Pin
manustone11-Dec-06 11:28
manustone11-Dec-06 11:28 
Questiondll creation from cpp files Pin
NAB3711-Dec-06 9:41
NAB3711-Dec-06 9:41 
QuestionI can't debug an MFC app anymore Pin
pblais11-Dec-06 8:25
pblais11-Dec-06 8:25 
AnswerRe: I can't debug an MFC app anymore Pin
pblais11-Dec-06 8:29
pblais11-Dec-06 8:29 
AnswerRe: I can't debug an MFC app anymore Pin
Michael Dunn11-Dec-06 9:05
sitebuilderMichael Dunn11-Dec-06 9:05 
GeneralThanks Mike Pin
pblais11-Dec-06 9:18
pblais11-Dec-06 9:18 
GeneralRe: Thanks Mike Pin
Michael Dunn11-Dec-06 10:51
sitebuilderMichael Dunn11-Dec-06 10:51 
QuestionNeed Help w/ Drawing to DC and then Blitting It Pin
CoffeeAddict1911-Dec-06 8:15
CoffeeAddict1911-Dec-06 8:15 
AnswerRe: Need Help w/ Drawing to DC and then Blitting It Pin
Mark Salsbery11-Dec-06 8:28
Mark Salsbery11-Dec-06 8:28 
QuestionSaving question Pin
DanYELL11-Dec-06 6:20
DanYELL11-Dec-06 6:20 
AnswerRe: Saving question Pin
Sam Hobbs11-Dec-06 18:56
Sam Hobbs11-Dec-06 18:56 
QuestionMFC UI Threads Pin
rrrado11-Dec-06 5:19
rrrado11-Dec-06 5:19 
AnswerRe: MFC UI Threads Pin
Mark Salsbery11-Dec-06 5:33
Mark Salsbery11-Dec-06 5:33 
GeneralRe: MFC UI Threads Pin
rrrado11-Dec-06 5:42
rrrado11-Dec-06 5:42 
GeneralRe: MFC UI Threads Pin
Mark Salsbery11-Dec-06 6:09
Mark Salsbery11-Dec-06 6:09 
GeneralRe: MFC UI Threads Pin
rrrado11-Dec-06 6:48
rrrado11-Dec-06 6:48 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.