Click here to Skip to main content
15,919,028 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionRecive TCP packets without TX [modified] Pin
mehdir211-Dec-08 5:00
mehdir211-Dec-08 5:00 
AnswerRe: Recive TCP packets without TX Pin
Randor 1-Dec-08 6:30
professional Randor 1-Dec-08 6:30 
QuestionInstead of using nested if-else Pin
krishnakumartm1-Dec-08 4:30
krishnakumartm1-Dec-08 4:30 
AnswerRe: Instead of using nested if-else Pin
Hamid_RT1-Dec-08 4:34
Hamid_RT1-Dec-08 4:34 
GeneralRe: Instead of using nested if-else Pin
Code-o-mat1-Dec-08 5:30
Code-o-mat1-Dec-08 5:30 
GeneralRe: Instead of using nested if-else Pin
ssclaire1-Dec-08 7:55
ssclaire1-Dec-08 7:55 
GeneralRe: Instead of using nested if-else Pin
CPallini1-Dec-08 8:09
mveCPallini1-Dec-08 8:09 
GeneralRe: Instead of using nested if-else Pin
Nemanja Trifunovic1-Dec-08 9:18
Nemanja Trifunovic1-Dec-08 9:18 
Actually, your "yuck" example is much better than the "more yack" one. The former is just yacky, and the later is dangerous (think introducing changes to the function and remembering to copy/paste all the resource cleanup).

The only robust and non-yacky way to handle this situation is use of The RAII programming idiom[^]

In this case, the destructors will make sure that all your resources are freed at the end of the scope - even if you throw an exception.


GeneralRe: Instead of using nested if-else Pin
Timothy Baldwin2-Dec-08 12:47
Timothy Baldwin2-Dec-08 12:47 
AnswerRe: Instead of using nested if-else Pin
CPallini1-Dec-08 5:47
mveCPallini1-Dec-08 5:47 
AnswerRe: Instead of using nested if-else Pin
David Crow1-Dec-08 10:17
David Crow1-Dec-08 10:17 
AnswerRe: Instead of using nested if-else Pin
bob169721-Dec-08 16:29
bob169721-Dec-08 16:29 
AnswerRe: Instead of using nested if-else Pin
sheshidar1-Dec-08 18:15
sheshidar1-Dec-08 18:15 
QuestionUsing "extern" Pin
krishnakumartm1-Dec-08 4:05
krishnakumartm1-Dec-08 4:05 
AnswerRe: Using "extern" Pin
Code-o-mat1-Dec-08 4:08
Code-o-mat1-Dec-08 4:08 
GeneralRe: Using "extern" Pin
krishnakumartm1-Dec-08 4:17
krishnakumartm1-Dec-08 4:17 
GeneralRe: Using "extern" Pin
Code-o-mat1-Dec-08 4:53
Code-o-mat1-Dec-08 4:53 
AnswerRe: Using "extern" Pin
CPallini1-Dec-08 5:41
mveCPallini1-Dec-08 5:41 
QuestionFocus rectangle on CDialogBox button Pin
J. Landsheer1-Dec-08 3:54
J. Landsheer1-Dec-08 3:54 
QuestionRe: Focus rectangle on CDialogBox button Pin
David Crow1-Dec-08 10:22
David Crow1-Dec-08 10:22 
AnswerRe: Focus rectangle on CDialogBox button Pin
J. Landsheer2-Dec-08 3:32
J. Landsheer2-Dec-08 3:32 
AnswerRe: Focus rectangle on CDialogBox button Pin
J. Landsheer9-Dec-08 2:34
J. Landsheer9-Dec-08 2:34 
Questionhow to give gray color Pin
Member 46556851-Dec-08 2:13
Member 46556851-Dec-08 2:13 
QuestionRe: how to give gray color Pin
CPallini1-Dec-08 2:23
mveCPallini1-Dec-08 2:23 
AnswerRe: how to give gray color Pin
Member 46556851-Dec-08 3:12
Member 46556851-Dec-08 3:12 

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.