Click here to Skip to main content
15,897,891 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: ExitInstance Pin
ThatsAlok4-Oct-06 19:14
ThatsAlok4-Oct-06 19:14 
GeneralRe: ExitInstance Pin
kk.tvm4-Oct-06 20:32
kk.tvm4-Oct-06 20:32 
GeneralRe: ExitInstance Pin
Naveen4-Oct-06 21:39
Naveen4-Oct-06 21:39 
GeneralRe: ExitInstance Pin
Naveen4-Oct-06 17:20
Naveen4-Oct-06 17:20 
GeneralRe: ExitInstance Pin
ThatsAlok4-Oct-06 7:37
ThatsAlok4-Oct-06 7:37 
GeneralRe: ExitInstance Pin
Naveen4-Oct-06 17:35
Naveen4-Oct-06 17:35 
AnswerRe: ExitInstance Pin
David Crow4-Oct-06 3:12
David Crow4-Oct-06 3:12 
AnswerRe: ExitInstance Pin
Antti Keskinen4-Oct-06 8:03
Antti Keskinen4-Oct-06 8:03 
MFC Dialog Based Applications generally act up in the following way:

1) Initialize MFC
2) Call InitInstance. Create and show the dialog box here, if it's a modal dialog box application
3) The dialog box terminates
4) InitInstance returns FALSE.
5) Call ExitInstance.
6) Terminate.

When a Dialog Box application's ExitInstance is running, the application's message pump is shut down already, and the application is preparing to terminate. Calling MessageBox will order the box to be a child of the desktop window, and will freeze the desktop while the box is being shown. This is generally a bad idea, since your application is outrightly blocking the desktop for the sake of displaying it's own message.

Put the MessageBox call to somewhere else. Anywhere but ExitInstance should do quite fine.. Perhaps right after the dialog terminates in InitInstance, but before InitInstance returns FALSE ?

- Antti Keskinen



----------------------------------------------
"If we wrote a report stating we saw a jet fighter with a howitzer, who's going to believe us ?"

-- R.A.F. pilot quote on seeing a Me 262 armed with a 50mm Mauser cannon.

GeneralRe: ExitInstance Pin
Naveen4-Oct-06 17:15
Naveen4-Oct-06 17:15 
GeneralRe: ExitInstance Pin
Antti Keskinen4-Oct-06 19:19
Antti Keskinen4-Oct-06 19:19 
GeneralRe: ExitInstance Pin
Naveen4-Oct-06 19:25
Naveen4-Oct-06 19:25 
QuestionUnable to retrieve Class ID Pin
narayanagvs3-Oct-06 20:00
narayanagvs3-Oct-06 20:00 
AnswerRe: Unable to retrieve Class ID Pin
ThatsAlok4-Oct-06 7:33
ThatsAlok4-Oct-06 7:33 
QuestionHow to write text to the command prompt in Dlg based Appln. Pin
zxc893-Oct-06 19:58
zxc893-Oct-06 19:58 
AnswerRe: How to write text to the command prompt in Dlg based Appln. Pin
Naveen3-Oct-06 20:06
Naveen3-Oct-06 20:06 
QuestionRe: How to write text to the command prompt in Dlg based Appln. Pin
zxc893-Oct-06 20:24
zxc893-Oct-06 20:24 
AnswerRe: How to write text to the command prompt in Dlg based Appln. Pin
Naveen3-Oct-06 20:36
Naveen3-Oct-06 20:36 
AnswerRe: How to write text to the command prompt in Dlg based Appln. Pin
David Crow4-Oct-06 3:19
David Crow4-Oct-06 3:19 
GeneralRe: How to write text to the command prompt in Dlg based Appln. Pin
Naveen4-Oct-06 17:27
Naveen4-Oct-06 17:27 
QuestionRe: How to write text to the command prompt in Dlg based Appln. Pin
zxc894-Oct-06 21:13
zxc894-Oct-06 21:13 
Questionsend to the socket Pin
yijia_243-Oct-06 19:23
yijia_243-Oct-06 19:23 
AnswerRe: send to the socket Pin
Naveen3-Oct-06 19:51
Naveen3-Oct-06 19:51 
QuestionRe: send to the socket Pin
yijia_243-Oct-06 20:16
yijia_243-Oct-06 20:16 
AnswerRe: send to the socket Pin
Naveen3-Oct-06 20:22
Naveen3-Oct-06 20:22 
AnswerRe: send to the socket Pin
ThatsAlok4-Oct-06 7:29
ThatsAlok4-Oct-06 7:29 

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.