Click here to Skip to main content
16,019,562 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: CMap with integer keys [modified] Pin
bob1697222-Aug-06 18:37
bob1697222-Aug-06 18:37 
GeneralRe: CMap with integer keys Pin
Blake Miller29-Sep-06 8:37
Blake Miller29-Sep-06 8:37 
GeneralRe: CMap with integer keys Pin
bob169721-Oct-06 7:56
bob169721-Oct-06 7:56 
GeneralRe: CMap with integer keys Pin
Blake Miller2-Oct-06 2:22
Blake Miller2-Oct-06 2:22 
Questionfunction hooks Pin
inebriate22-Aug-06 8:55
inebriate22-Aug-06 8:55 
AnswerRe: function hooks Pin
Jörgen Sigvardsson22-Aug-06 13:54
Jörgen Sigvardsson22-Aug-06 13:54 
AnswerRe: function hooks Pin
Dave Calkins22-Aug-06 18:15
Dave Calkins22-Aug-06 18:15 
Questionexceptions Pin
jon-8022-Aug-06 8:48
professionaljon-8022-Aug-06 8:48 
I am trying to indicate that class CSentenceAr COULD throw the same object as an exception:

SentenceAr.h

class CSentenceAr
{
...
protected:
bool readFile(char strFileToRead[MAX_SENTENCE_LENGTH + 1]) throw (CSentenceAr);
// #1 (see below)
...
};

SentenceAr.cpp

bool CSentenceAr::readFile(char strFileToRead[MAX_FILENAME_LENGTH])
{
char strLine[MAX_SENTENCE_LENGTH + 1];

fstream fileToRead(strFileToRead,ios::in);

if (ios::good != false)
...
return true;
}
else
{ //Error: file cannot be read
throw (CSentenceAr);
// #2 (see below)
return false;
}

fileToRead.close();

}

#1: \SentenceAr.h(21): warning C4290: C++ exception specification ignored except to indicate a function is not __declspec(nothrow)

#2: \SentenceAr.cpp(43): error C2059: syntax error : ';'





Jon
QuestionRe: exceptions Pin
David Crow22-Aug-06 8:57
David Crow22-Aug-06 8:57 
AnswerRe: exceptions Pin
jon-8022-Aug-06 9:06
professionaljon-8022-Aug-06 9:06 
GeneralRe: exceptions Pin
Zac Howland22-Aug-06 9:10
Zac Howland22-Aug-06 9:10 
GeneralRe: exceptions Pin
David Crow22-Aug-06 9:21
David Crow22-Aug-06 9:21 
GeneralRe: exceptions Pin
Zac Howland22-Aug-06 9:22
Zac Howland22-Aug-06 9:22 
QuestionRe: exceptions Pin
David Crow22-Aug-06 9:32
David Crow22-Aug-06 9:32 
AnswerRe: exceptions Pin
Zac Howland22-Aug-06 9:42
Zac Howland22-Aug-06 9:42 
GeneralRe: exceptions Pin
David Crow22-Aug-06 9:47
David Crow22-Aug-06 9:47 
GeneralRe: exceptions Pin
Zac Howland22-Aug-06 10:08
Zac Howland22-Aug-06 10:08 
GeneralRe: exceptions Pin
David Crow22-Aug-06 10:25
David Crow22-Aug-06 10:25 
GeneralRe: exceptions Pin
Zac Howland22-Aug-06 13:34
Zac Howland22-Aug-06 13:34 
AnswerRe: exceptions Pin
Zac Howland22-Aug-06 9:09
Zac Howland22-Aug-06 9:09 
GeneralRe: exceptions Pin
Cedric Moonen22-Aug-06 9:23
Cedric Moonen22-Aug-06 9:23 
GeneralRe: exceptions Pin
Zac Howland22-Aug-06 9:46
Zac Howland22-Aug-06 9:46 
AnswerRe: exceptions Pin
jon-8022-Aug-06 9:38
professionaljon-8022-Aug-06 9:38 
GeneralRe: exceptions Pin
Zac Howland22-Aug-06 9:52
Zac Howland22-Aug-06 9:52 
AnswerRe: exceptions Pin
markkuk22-Aug-06 11:22
markkuk22-Aug-06 11:22 

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.