Click here to Skip to main content
15,912,756 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: External program launch issue Pin
Hamid_RT14-Jun-06 5:55
Hamid_RT14-Jun-06 5:55 
GeneralRe: External program launch issue Pin
Tnarol14-Jun-06 3:37
Tnarol14-Jun-06 3:37 
GeneralRe: External program launch issue Pin
_AnsHUMAN_ 14-Jun-06 3:44
_AnsHUMAN_ 14-Jun-06 3:44 
GeneralRe: External program launch issue Pin
toxcct14-Jun-06 3:46
toxcct14-Jun-06 3:46 
GeneralRe: External program launch issue Pin
_AnsHUMAN_ 14-Jun-06 3:50
_AnsHUMAN_ 14-Jun-06 3:50 
GeneralRe: External program launch issue Pin
Laxman Auti14-Jun-06 4:03
Laxman Auti14-Jun-06 4:03 
QuestionHRESULT to exception [modified] Pin
scoroop14-Jun-06 3:16
scoroop14-Jun-06 3:16 
AnswerRe: HRESULT to exception Pin
Viorel.14-Jun-06 4:02
Viorel.14-Jun-06 4:02 
Perhaps macros are suitable for you, something like this:

#define CHECK(expr) { if((expr) != S_OK) throw MyException; };

where MyException is your own class. (In case of STL, you can derive it from std::runtime_error).

A sample usage:

try
{
    CHECK(CoCreateInstance(...));
    . . .
}
catch( const MyException & ex)
{
   // exception occured
}

Now you do not have ifs. Anyway, within exception handler you have to provide a method for releasing objects created successfully earlier.
AnswerRe: HRESULT to exception Pin
Nemanja Trifunovic14-Jun-06 6:02
Nemanja Trifunovic14-Jun-06 6:02 
GeneralRe: HRESULT to exception Pin
scoroop14-Jun-06 13:08
scoroop14-Jun-06 13:08 
GeneralRe: HRESULT to exception Pin
Michael Dunn14-Jun-06 18:45
sitebuilderMichael Dunn14-Jun-06 18:45 
GeneralRe: HRESULT to exception Pin
scoroop15-Jun-06 20:56
scoroop15-Jun-06 20:56 
GeneralRe: HRESULT to exception Pin
Michael Dunn15-Jun-06 21:13
sitebuilderMichael Dunn15-Jun-06 21:13 
QuestionSubject: GUI design in VS 2005 Pin
kitty514-Jun-06 2:57
kitty514-Jun-06 2:57 
AnswerRe: Subject: GUI design in VS 2005 Pin
Cedric Moonen14-Jun-06 3:12
Cedric Moonen14-Jun-06 3:12 
AnswerRe: Subject: GUI design in VS 2005 [modified] Pin
James R. Twine14-Jun-06 3:55
James R. Twine14-Jun-06 3:55 
QuestionSTL set_intersection Pin
Abhi Lahare14-Jun-06 2:53
Abhi Lahare14-Jun-06 2:53 
AnswerRe: STL set_intersection Pin
Laxman Auti14-Jun-06 3:09
Laxman Auti14-Jun-06 3:09 
AnswerRe: STL set_intersection Pin
_AnsHUMAN_ 14-Jun-06 3:13
_AnsHUMAN_ 14-Jun-06 3:13 
AnswerRe: STL set_intersection Pin
Laxman Auti14-Jun-06 3:26
Laxman Auti14-Jun-06 3:26 
QuestionImageList in ListCtrl behaves differently in debug or release Pin
e-DJ14-Jun-06 2:47
e-DJ14-Jun-06 2:47 
GeneralRe: ImageList in ListCtrl behaves differently in debug or release Pin
Laxman Auti14-Jun-06 2:51
Laxman Auti14-Jun-06 2:51 
GeneralRe: ImageList in ListCtrl behaves differently in debug or release Pin
e-DJ24-Jul-06 6:13
e-DJ24-Jul-06 6:13 
AnswerRe: ImageList in ListCtrl behaves differently in debug or release Pin
Naveen14-Jun-06 2:57
Naveen14-Jun-06 2:57 
QuestionHow to hide the tabs in PropertyPage Pin
si_6914-Jun-06 2:43
si_6914-Jun-06 2:43 

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.