Click here to Skip to main content
15,918,808 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: InterpX function limitation (from Interp32.xll Excel addin) Pin
M.Slipper18-Sep-08 10:30
M.Slipper18-Sep-08 10:30 
QuestionSafe premature shutdown of application Pin
frqftgbdafr18-Sep-08 7:50
frqftgbdafr18-Sep-08 7:50 
AnswerRe: Safe premature shutdown of application Pin
Iain Clarke, Warrior Programmer18-Sep-08 8:00
Iain Clarke, Warrior Programmer18-Sep-08 8:00 
GeneralRe: Safe premature shutdown of application Pin
frqftgbdafr18-Sep-08 8:45
frqftgbdafr18-Sep-08 8:45 
QuestionRe: Safe premature shutdown of application Pin
Mark Salsbery18-Sep-08 8:50
Mark Salsbery18-Sep-08 8:50 
AnswerRe: Safe premature shutdown of application Pin
frqftgbdafr18-Sep-08 9:41
frqftgbdafr18-Sep-08 9:41 
GeneralRe: Safe premature shutdown of application Pin
Mark Salsbery18-Sep-08 10:03
Mark Salsbery18-Sep-08 10:03 
GeneralRe: Safe premature shutdown of application Pin
Bram van Kampen18-Sep-08 14:36
Bram van Kampen18-Sep-08 14:36 
I found that exit(0), usually does the trick. But be VERY carefull about what you log under 'onexit()'. BTW are you letting the User know why this happens? (Or do you write particulars to a Log File?, ifso, say that in a MessageBox.) Also, is there any User data to be saved? (Probably Not...).
Otherwise you may end up with an App that under Obscure Circumstances refuses to Start, without any visual effects. (Doubleclick 'exe', Hourglass Appears, Hourglass Dies, Nothing Happens. (Been there, have several teeshirts).

What I found usefull, was to write a Global Termination procedure:

void Terminate(DWORD ErrCode=MYERR_SUCCESS){
if(ErrCode==MYERR_SUCCESS)exit(0);
CString ErrMsg=GetErrMsg(ErrCode)
AfxMessageBox(ErrMsg,MB_ICONSTOP);
CErrorLog::LogError(ErrCode);
exit(ErrCode);
}

Hope this is Usefull Smile | :)

Bram van Kampen

GeneralRe: Safe premature shutdown of application Pin
Mark Salsbery19-Sep-08 6:51
Mark Salsbery19-Sep-08 6:51 
QuestionUsing a Toolbar with Property Sheets Pin
si_6918-Sep-08 6:31
si_6918-Sep-08 6:31 
QuestionAppearance of ActiveX Control at Design-time Pin
hhh18-Sep-08 5:46
hhh18-Sep-08 5:46 
Questionpublic struct in a class Pin
Cengine18-Sep-08 5:38
Cengine18-Sep-08 5:38 
AnswerRe: public struct in a class Pin
toxcct18-Sep-08 5:52
toxcct18-Sep-08 5:52 
GeneralRe: public struct in a class Pin
Cengine18-Sep-08 5:58
Cengine18-Sep-08 5:58 
GeneralRe: public struct in a class Pin
toxcct18-Sep-08 6:02
toxcct18-Sep-08 6:02 
GeneralRe: public struct in a class Pin
Cengine18-Sep-08 6:06
Cengine18-Sep-08 6:06 
AnswerRe: public struct in a class Pin
Matthew Faithfull18-Sep-08 6:12
Matthew Faithfull18-Sep-08 6:12 
QuestionBitBlt does not work in print preview Pin
theCPkid18-Sep-08 5:29
theCPkid18-Sep-08 5:29 
AnswerRe: BitBlt does not work in print preview Pin
Mark Salsbery18-Sep-08 5:49
Mark Salsbery18-Sep-08 5:49 
GeneralRe: BitBlt does not work in print preview Pin
theCPkid18-Sep-08 5:54
theCPkid18-Sep-08 5:54 
QuestionRe: BitBlt does not work in print preview Pin
Mark Salsbery18-Sep-08 5:57
Mark Salsbery18-Sep-08 5:57 
AnswerRe: BitBlt does not work in print preview Pin
theCPkid18-Sep-08 6:03
theCPkid18-Sep-08 6:03 
GeneralRe: BitBlt does not work in print preview Pin
Mark Salsbery18-Sep-08 6:34
Mark Salsbery18-Sep-08 6:34 
GeneralRe: BitBlt does not work in print preview [modified] Pin
theCPkid18-Sep-08 7:01
theCPkid18-Sep-08 7:01 
GeneralRe: BitBlt does not work in print preview Pin
Mark Salsbery18-Sep-08 7:25
Mark Salsbery18-Sep-08 7:25 

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.