Click here to Skip to main content
14,972,640 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Trying to understand my mistake... with pointers Pin
leon de boer29-Jul-16 17:53
Memberleon de boer29-Jul-16 17:53 
Questionhow to create a file input button in microsoft visual c ++ ? Pin
jhonganteng28-Jul-16 3:46
Memberjhonganteng28-Jul-16 3:46 
AnswerRe: how to create a file input button in microsoft visual c ++ ? Pin
Richard MacCutchan28-Jul-16 4:30
mveRichard MacCutchan28-Jul-16 4:30 
QuestionHelp With Exception Pin
ForNow26-Jul-16 12:47
MemberForNow26-Jul-16 12:47 
AnswerRe: Help With Exception Pin
leon de boer26-Jul-16 17:22
Memberleon de boer26-Jul-16 17:22 
GeneralRe: Help With Exception Pin
ForNow26-Jul-16 20:01
MemberForNow26-Jul-16 20:01 
GeneralRe: Help With Exception Pin
leon de boer26-Jul-16 22:33
Memberleon de boer26-Jul-16 22:33 
AnswerRe: Help With Exception Pin
Jochen Arndt26-Jul-16 21:47
professionalJochen Arndt26-Jul-16 21:47 
MFC throws exceptions derived from the CException class which contain additional information and provide a function to show a message.

So you may add this block of code on front of your CATCH_ALL block:
CATCH(CException, pEx)
{
    pEx->ReportError();
    pEx->Delete();
}


The operation that might fail in your code is CString::SetAt (when the position is beyond the end of the string). This will throw an exception in release builds and assert with debug builds. Because you are not getting an assertion with a debug build, the only reason for an exception in release builds can be a different (shorter) PSW.ia string. If this is not the case the exception source is probably somewhere else.

To avoid such out of range acesses you should check the length or use a function that handles them like CString::Left.
GeneralRe: Help With Exception Pin
ForNow27-Jul-16 2:14
MemberForNow27-Jul-16 2:14 
GeneralRe: Help With Exception Pin
Jochen Arndt27-Jul-16 2:18
professionalJochen Arndt27-Jul-16 2:18 
GeneralRe: Help With Exception you where right !!!!!!!! Pin
ForNow27-Jul-16 15:15
MemberForNow27-Jul-16 15:15 
QuestionChoosing between strings Pin
Anthony Appleyard26-Jul-16 9:47
MemberAnthony Appleyard26-Jul-16 9:47 
AnswerRe: Choosing between strings Pin
Richard MacCutchan26-Jul-16 21:11
mveRichard MacCutchan26-Jul-16 21:11 
QuestionNewbee Exception handling Guidance Pin
ForNow25-Jul-16 4:35
MemberForNow25-Jul-16 4:35 
AnswerRe: Newbee Exception handling Guidance Pin
Jochen Arndt25-Jul-16 4:57
professionalJochen Arndt25-Jul-16 4:57 
GeneralRe: Newbee Exception handling Guidance Pin
ForNow25-Jul-16 5:31
MemberForNow25-Jul-16 5:31 
AnswerRe: Newbee Exception handling Guidance Pin
Richard MacCutchan25-Jul-16 5:12
mveRichard MacCutchan25-Jul-16 5:12 
GeneralRe: Newbee Exception handling Guidance Pin
ForNow25-Jul-16 5:30
MemberForNow25-Jul-16 5:30 
GeneralRe: Newbee Exception handling Guidance Pin
ForNow25-Jul-16 6:32
MemberForNow25-Jul-16 6:32 
GeneralRe: Newbee Exception handling Guidance Pin
Richard MacCutchan25-Jul-16 6:46
mveRichard MacCutchan25-Jul-16 6:46 
QuestionRe: Newbee Exception handling Guidance Pin
David Crow25-Jul-16 16:59
MemberDavid Crow25-Jul-16 16:59 
AnswerRe: Newbee Exception handling Guidance Pin
ForNow26-Jul-16 1:56
MemberForNow26-Jul-16 1:56 
GeneralRe: Newbee Exception handling Guidance Pin
David Crow26-Jul-16 2:04
MemberDavid Crow26-Jul-16 2:04 
GeneralRe: Newbee Exception handling Guidance Pin
jeron126-Jul-16 4:22
Memberjeron126-Jul-16 4:22 
GeneralRe: Newbee Exception handling Guidance Pin
Daniel Pfeffer26-Jul-16 4:33
professionalDaniel Pfeffer26-Jul-16 4:33 

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.