Click here to Skip to main content
15,914,413 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Change the background colour of CCombobox? Pin
vikramlinux20-Feb-03 23:18
vikramlinux20-Feb-03 23:18 
GeneralInterfaces to other applications Pin
User 988520-Feb-03 12:57
User 988520-Feb-03 12:57 
GeneralRe: Interfaces to other applications Pin
Brian Olej20-Feb-03 13:52
Brian Olej20-Feb-03 13:52 
GeneralRe: Interfaces to other applications Pin
User 988520-Feb-03 13:59
User 988520-Feb-03 13:59 
GeneralRe: Interfaces to other applications Pin
Brian Olej20-Feb-03 14:26
Brian Olej20-Feb-03 14:26 
GeneralRe: Interfaces to other applications Pin
Anders Molin20-Feb-03 14:07
professionalAnders Molin20-Feb-03 14:07 
GeneralRe: Interfaces to other applications Pin
User 988521-Feb-03 3:06
User 988521-Feb-03 3:06 
General"Try" to "Catch" without "Throw" Pin
Anton A. Loukine20-Feb-03 11:39
Anton A. Loukine20-Feb-03 11:39 
This is probably a dumb question, but I am a newbie:

I am trying to catch error if an attemp is made to read past the end of an array.

For example I have an array double fVector[10];

Then I have the following code:

try {
for( int n = 0; n < 50; n++ ) {
a[n] = fVector[n];
}
} catch( int ) {
printf("Error!!!");
}

The problem may (and sometimes may not) result if I try to access element #11. But how do I catch that? If I knew the length of fVector, I could add something like this:

if( n > nLength ) throw 1;

but what if I don't know it? How can I trap the error before the application crashes with an invalid memory address error?

Thanks
GeneralRe: "Try" to "Catch" without "Throw" Pin
Dave Bryant20-Feb-03 11:51
Dave Bryant20-Feb-03 11:51 
GeneralRe: "Try" to "Catch" without "Throw" Pin
Anton A. Loukine20-Feb-03 11:58
Anton A. Loukine20-Feb-03 11:58 
GeneralRe: "Try" to "Catch" without "Throw" Pin
Gary R. Wheeler20-Feb-03 14:36
Gary R. Wheeler20-Feb-03 14:36 
GeneralRephrasing the question Pin
Anonymous21-Feb-03 3:18
Anonymous21-Feb-03 3:18 
GeneralRe: Rephrasing the question Pin
jhwurmbach21-Feb-03 3:34
jhwurmbach21-Feb-03 3:34 
GeneralRe: Rephrasing the question Pin
Gary R. Wheeler21-Feb-03 11:22
Gary R. Wheeler21-Feb-03 11:22 
GeneralRe: "Try" to "Catch" without "Throw" Pin
Chris Losinger20-Feb-03 12:06
professionalChris Losinger20-Feb-03 12:06 
GeneralRe: "Try" to "Catch" without "Throw" Pin
markkuk20-Feb-03 12:32
markkuk20-Feb-03 12:32 
GeneralRe: "Try" to "Catch" without "Throw" Pin
Anton A. Loukine20-Feb-03 12:44
Anton A. Loukine20-Feb-03 12:44 
GeneralRe: "Try" to "Catch" without "Throw" Pin
jhwurmbach20-Feb-03 21:00
jhwurmbach20-Feb-03 21:00 
GeneralRe: "Try" to "Catch" without "Throw" Pin
Anonymous21-Feb-03 3:19
Anonymous21-Feb-03 3:19 
GeneralRe: "Try" to "Catch" without "Throw" Pin
jhwurmbach21-Feb-03 3:49
jhwurmbach21-Feb-03 3:49 
GeneralRe: "Try" to "Catch" without "Throw" Pin
Christian Graus20-Feb-03 16:08
protectorChristian Graus20-Feb-03 16:08 
GeneralCopy opened files (read protected files) Pin
JGranborg20-Feb-03 11:37
JGranborg20-Feb-03 11:37 
GeneralCannot run MFC-compiled application on Win98se Pin
Valera24117620-Feb-03 11:21
Valera24117620-Feb-03 11:21 
GeneralRe: Cannot run MFC-compiled application on Win98se Pin
PJ Arends20-Feb-03 11:45
professionalPJ Arends20-Feb-03 11:45 
GeneralRe: Cannot run MFC-compiled application on Win98se Pin
Anonymous20-Feb-03 13:37
Anonymous20-Feb-03 13:37 

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.