Click here to Skip to main content
15,921,716 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Get Selected Text Pin
Mahesh Kulkarni11-Dec-06 19:57
Mahesh Kulkarni11-Dec-06 19:57 
GeneralRe: Get Selected Text Pin
Rajesh R Subramanian11-Dec-06 20:13
professionalRajesh R Subramanian11-Dec-06 20:13 
QuestionString command differences Pin
Oliver12311-Dec-06 12:18
Oliver12311-Dec-06 12:18 
AnswerRe: String command differences Pin
Mark Salsbery11-Dec-06 12:57
Mark Salsbery11-Dec-06 12:57 
AnswerRe: String command differences Pin
George L. Jackson11-Dec-06 15:05
George L. Jackson11-Dec-06 15:05 
AnswerRe: String command differences Pin
prasad_som11-Dec-06 17:44
prasad_som11-Dec-06 17:44 
AnswerRe: String command differences Pin
James R. Twine12-Dec-06 1:59
James R. Twine12-Dec-06 1:59 
GeneralRe: String command differences Pin
Mark Salsbery12-Dec-06 8:04
Mark Salsbery12-Dec-06 8:04 
GeneralRe: String command differences Pin
James R. Twine13-Dec-06 2:34
James R. Twine13-Dec-06 2:34 
GeneralRe: String command differences Pin
Mark Salsbery13-Dec-06 5:17
Mark Salsbery13-Dec-06 5:17 
QuestionWhy is Visual before Visual C++? Pin
Code232611-Dec-06 11:18
Code232611-Dec-06 11:18 
AnswerRe: Why is Visual before Visual C++? Pin
Fernando A. Gomez F.11-Dec-06 14:56
Fernando A. Gomez F.11-Dec-06 14:56 
AnswerRe: Why is Visual before Visual C++? Pin
George L. Jackson11-Dec-06 15:12
George L. Jackson11-Dec-06 15:12 
AnswerRe: Why is Visual before Visual C++? Pin
ThatsAlok11-Dec-06 17:35
ThatsAlok11-Dec-06 17:35 
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 

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.