Click here to Skip to main content
15,895,667 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: TextOut text positioning oddity Pin
Mark Salsbery12-Apr-08 4:19
Mark Salsbery12-Apr-08 4:19 
GeneralRe: TextOut text positioning oddity Pin
Anthony Appleyard12-Apr-08 5:41
Anthony Appleyard12-Apr-08 5:41 
GeneralRe: TextOut text positioning oddity Pin
Mark Salsbery12-Apr-08 5:52
Mark Salsbery12-Apr-08 5:52 
QuestionEndDialog doesn't terminate the app! Pin
Joseph Marzbani12-Apr-08 2:47
Joseph Marzbani12-Apr-08 2:47 
GeneralRe: EndDialog doesn't terminate the app! Pin
Luc Pattyn12-Apr-08 3:02
sitebuilderLuc Pattyn12-Apr-08 3:02 
GeneralRe: EndDialog doesn't terminate the app! Pin
Joseph Marzbani12-Apr-08 3:10
Joseph Marzbani12-Apr-08 3:10 
GeneralRe: EndDialog doesn't terminate the app! Pin
Luc Pattyn12-Apr-08 4:10
sitebuilderLuc Pattyn12-Apr-08 4:10 
AnswerRe: EndDialog doesn't terminate the app! Pin
Mark Salsbery12-Apr-08 4:28
Mark Salsbery12-Apr-08 4:28 
EndDialog() may be the wrong method for shutting down your app.

It depends on how and where you create the main dialog.  Is it modal or modeless?
Where in the code do you create it?

CDialog::EndDialog is for modal dialogs.  That means your main dialog needs to be created modal.
When control returns from the modal dialog, your app needs to exit.  It should be something like this:
BOOL CMyApp::InitInstance()
{
    // do app initialization here!
    // ...


    CMyMainDlg dlg;
    m_pMainWnd = &dlg;
    INT_PTR nResponse = dlg.DoModal();
    if (nResponse == IDOK)
    {
        // TODO: Place code here to handle when the dialog is
        //  dismissed with OK
    }
    else if (nResponse == IDCANCEL)
    {
        // TODO: Place code here to handle when the dialog is
        //  dismissed with Cancel
    }

    // Since the dialog has been closed, return FALSE so that we exit the
    //  application, rather than start the application's message pump.
    return FALSE;
}
If you return TRUE from InitInstance(), that would cause the behavior you're seeing, since the app
would still be running but the dialog would be gone.

Mark





Mark Salsbery
Microsoft MVP - Visual C++

Java | [Coffee]

GeneralRe: EndDialog doesn't terminate the app! Pin
Joseph Marzbani12-Apr-08 6:29
Joseph Marzbani12-Apr-08 6:29 
GeneralRe: EndDialog doesn't terminate the app! Pin
Hamid_RT14-Apr-08 4:30
Hamid_RT14-Apr-08 4:30 
Questionusing the '€'-sign with std::wofstream doesn't work Pin
souljumper12-Apr-08 1:48
souljumper12-Apr-08 1:48 
GeneralRe: using the '€'-sign with std::wofstream doesn't work Pin
CPallini12-Apr-08 2:13
mveCPallini12-Apr-08 2:13 
AnswerRe: using the '€'-sign with std::wofstream doesn't work Pin
souljumper12-Apr-08 11:17
souljumper12-Apr-08 11:17 
GeneralPassing parameter through ShellExecute Pin
neha.agarwal2712-Apr-08 1:38
neha.agarwal2712-Apr-08 1:38 
GeneralRe: Passing parameter through ShellExecute Pin
CPallini12-Apr-08 2:30
mveCPallini12-Apr-08 2:30 
GeneralRe: Passing parameter through ShellExecute Pin
neha.agarwal2712-Apr-08 2:38
neha.agarwal2712-Apr-08 2:38 
GeneralRe: Passing parameter through ShellExecute Pin
Luc Pattyn12-Apr-08 3:10
sitebuilderLuc Pattyn12-Apr-08 3:10 
GeneralProblems occuring when compiling C++ Programs using visual C++ 6 Pin
scene_8412-Apr-08 0:45
scene_8412-Apr-08 0:45 
GeneralRe: Problems occuring when compiling C++ Programs using visual C++ 6 Pin
CPallini12-Apr-08 1:51
mveCPallini12-Apr-08 1:51 
GeneralRe: Problems occuring when compiling C++ Programs using visual C++ 6 Pin
Joseph Marzbani12-Apr-08 2:54
Joseph Marzbani12-Apr-08 2:54 
GeneralRe: Problems occuring when compiling C++ Programs using visual C++ 6 Pin
CPallini12-Apr-08 4:42
mveCPallini12-Apr-08 4:42 
QuestionHow set the Form on the center of my screen ? Pin
Schehaider_Aymen11-Apr-08 23:44
Schehaider_Aymen11-Apr-08 23:44 
AnswerRe: How set the Form on the center of my screen ? Pin
ftbk11-Apr-08 23:57
ftbk11-Apr-08 23:57 
GeneralRe: How set the Form on the center of my screen ? Pin
Schehaider_Aymen12-Apr-08 0:08
Schehaider_Aymen12-Apr-08 0:08 
AnswerRe: How set the Form on the center of my screen ? Pin
Schehaider_Aymen12-Apr-08 0:41
Schehaider_Aymen12-Apr-08 0: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.