Click here to Skip to main content
15,884,836 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: how do i write this program? Pin
Patrice T28-Jan-17 13:15
mvePatrice T28-Jan-17 13:15 
QuestionPerformance issue when drawing on MFC Pin
Member 162132325-Jan-17 10:59
Member 162132325-Jan-17 10:59 
AnswerRe: Performance issue when drawing on MFC Pin
leon de boer25-Jan-17 18:25
leon de boer25-Jan-17 18:25 
GeneralRe: Performance issue when drawing on MFC Pin
Member 162132326-Jan-17 10:28
Member 162132326-Jan-17 10:28 
GeneralRe: Performance issue when drawing on MFC Pin
leon de boer26-Jan-17 17:50
leon de boer26-Jan-17 17:50 
Questionfree memory when constructor throw exception Pin
john563219-Jan-17 17:49
john563219-Jan-17 17:49 
AnswerRe: free memory when constructor throw exception Pin
rxantos19-Jan-17 19:05
rxantos19-Jan-17 19:05 
AnswerRe: free memory when constructor throw exception Pin
«_Superman_»19-Jan-17 19:32
professional«_Superman_»19-Jan-17 19:32 
Move the memory allocation to a class of its own so that the new happens in its constructor and delete happens in its destructor. That should be the only responsibility of the allocating class.

In the class whos constructor throws, create an object of the allocating class on the stack.

Since destructors are only called for objects that are fully constructed, the allocating class destructor is always guaranteed to be called.
«_Superman 
I love work. It gives me something to do between weekends.


Microsoft MVP (Visual C++) (October 2009 - September 2013)

Polymorphism in C

AnswerRe: free memory when constructor throw exception Pin
Albert Holguin20-Jan-17 10:14
professionalAlbert Holguin20-Jan-17 10:14 
QuestionSend data to POS Printer by USB Pin
Member 1286002219-Jan-17 16:10
Member 1286002219-Jan-17 16:10 
AnswerRe: Send data to POS Printer by USB Pin
«_Superman_»19-Jan-17 19:48
professional«_Superman_»19-Jan-17 19:48 
SuggestionRe: Send data to POS Printer by USB Pin
David Crow20-Jan-17 3:15
David Crow20-Jan-17 3:15 
QuestionLight weight solution for distrubted memory map Pin
Member 380393118-Jan-17 16:12
Member 380393118-Jan-17 16:12 
QuestionGdiplus: DrawImage not working Pin
Member 162132314-Jan-17 3:28
Member 162132314-Jan-17 3:28 
AnswerRe: Gdiplus: DrawImage not working Pin
leon de boer14-Jan-17 23:45
leon de boer14-Jan-17 23:45 
GeneralRe: Gdiplus: DrawImage not working Pin
Member 162132325-Jan-17 10:57
Member 162132325-Jan-17 10:57 
Questionwhat?where? Pin
Member 1294982214-Jan-17 1:54
Member 1294982214-Jan-17 1:54 
AnswerRe: what?where? Pin
Afzaal Ahmad Zeeshan14-Jan-17 2:59
professionalAfzaal Ahmad Zeeshan14-Jan-17 2:59 
AnswerRe: what?where? Pin
Patrice T14-Jan-17 16:03
mvePatrice T14-Jan-17 16:03 
AnswerRe: what?where? Pin
jeron116-Jan-17 5:15
jeron116-Jan-17 5:15 
GeneralRe: what?where? Pin
Daniel Pfeffer16-Jan-17 5:22
professionalDaniel Pfeffer16-Jan-17 5:22 
GeneralRe: what?where? Pin
NotPolitcallyCorrect16-Jan-17 9:20
NotPolitcallyCorrect16-Jan-17 9:20 
QuestionDisable a Tab on CPropertySheet Pin
Member 1294722612-Jan-17 4:58
Member 1294722612-Jan-17 4:58 
AnswerRe: Disable a Tab on CPropertySheet Pin
David Crow12-Jan-17 5:19
David Crow12-Jan-17 5:19 
GeneralRe: Disable a Tab on CPropertySheet Pin
Member 129472265-Feb-17 20:45
Member 129472265-Feb-17 20:45 

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.