In VS2013, i created an MFC Application Dialoged Based. I modify the project in order to use PropertyPage and Propertysheet at the beginning of the application, so, instead of lauching a CDialog, it launch my propertypage.
After, I created a Dialog, and the class associates ( from::CdialogEx). I would like to open this dialog behind a button click.
Behind my button click, i do:
CMyDialog myDialog;
myDialog.DoModal();
I don't have any error message, but, i don't show my Dialog at the screen.
Maybe it's because this dialog has no child no ?
Anyone could help me please ?
Thanks a lot,
Best regards,
Nixeus
EDIT :
Here is my Entry point :
#include "stdafx.h"
#include "KenoApp.h"
#include "KenoDlg.h"
#include "GenerationDlg.h"
#include "KenoSheet.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
// CKenoApp
BEGIN_MESSAGE_MAP(CKenoApp, CWinApp)
ON_COMMAND(ID_HELP, &CWinApp::OnHelp)
END_MESSAGE_MAP()
// construction CKenoApp
CKenoApp::CKenoApp()
{
}
// Seul et unique objet CKenoApp
CKenoApp theApp;
// initialisation de CKenoApp
BOOL CKenoApp::InitInstance()
{
AfxEnableControlContainer();
// Standard initialization
#ifdef _AFXDLL
// Call this when using MFC in a shared DLL
#else
Enable3dControlsStatic(); // Call this when linking to MFC statically
#endif
CKenoSheet KenoSheet;
KenoSheet.SetTitle(L"Keno Helper v1.1");
CGenerationDlg Generation;
CKenoDlg KenoDlg;
KenoSheet.AddPage(&KenoDlg);
KenoSheet.AddPage(&Generation);
//m_pMainWnd = &KenoSheet;
int nResponse = KenoSheet.DoModal();
// Since the dialog has been closed, return FALSE so that we exit the
// application, rather than start the application's message pump.
return FALSE;
}
And after, on my property page :
CAboutDlg myDialog;
theApp.m_pMainWnd = &myDialog;
myDialog.DoModal();
My problem is now that, the DoModal() close my application.