Click here to Skip to main content
15,887,746 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionprogram leaks memory when i resize [modified] Pin
leorex8-Mar-11 0:16
leorex8-Mar-11 0:16 
AnswerRe: program leaks memory when i resize Pin
Code-o-mat8-Mar-11 0:32
Code-o-mat8-Mar-11 0:32 
AnswerRe: program leaks memory when i resize Pin
CPallini8-Mar-11 0:51
mveCPallini8-Mar-11 0:51 
AnswerRe: program leaks memory when i resize Pin
Hans Dietrich8-Mar-11 1:13
mentorHans Dietrich8-Mar-11 1:13 
AnswerRe: program leaks memory when i resize Pin
leorex8-Mar-11 21:00
leorex8-Mar-11 21:00 
GeneralRe: program leaks memory when i resize Pin
Richard MacCutchan8-Mar-11 21:35
mveRichard MacCutchan8-Mar-11 21:35 
AnswerRe: program leaks memory when i resize Pin
Code-o-mat8-Mar-11 23:05
Code-o-mat8-Mar-11 23:05 
GeneralRe: program leaks memory when i resize Pin
leorex9-Mar-11 0:14
leorex9-Mar-11 0:14 
PROBLEM SOLVED!!!

close to no memory leak with this in the for loop (still goes up by like a few bytes once in a while >.< but it doesnt really interfere with the program so i guess its ok =_=)

hBrush_1 = CreateSolidBrush(color[i_row][j_column]);
SelectObject(hdc, hBrush_1);
Rectangle(hdc, 90*j_column+100, 50+30*i_row, 90*j_column+180, 30*i_row+75); //rember is x, y, x, y
DeleteObject(hBrush_1);


to be perfectly honest I do not get the explanation with holdbrush.

"you won't know the original brush and won't be able to select it back into the DC when you are done."

sorry if it is a neeeewb question, but why?
GeneralRe: program leaks memory when i resize Pin
Code-o-mat9-Mar-11 0:44
Code-o-mat9-Mar-11 0:44 
GeneralRe: program leaks memory when i resize Pin
leorex9-Mar-11 10:21
leorex9-Mar-11 10:21 
GeneralRe: program leaks memory when i resize Pin
Code-o-mat9-Mar-11 10:27
Code-o-mat9-Mar-11 10:27 
AnswerRe: program leaks memory when i resize Pin
SledgeHammer019-Mar-11 13:58
SledgeHammer019-Mar-11 13:58 
Questionput image on client area of main frame windows Pin
Max++7-Mar-11 19:37
Max++7-Mar-11 19:37 
AnswerRe: put image on client area of main frame windows Pin
Hans Dietrich7-Mar-11 19:45
mentorHans Dietrich7-Mar-11 19:45 
GeneralRe: put image on client area of main frame windows Pin
Max++7-Mar-11 20:09
Max++7-Mar-11 20:09 
QuestionSmall IVR Development Pin
AmbiguousName7-Mar-11 8:35
AmbiguousName7-Mar-11 8:35 
QuestionRe: Small IVR Development Pin
Maximilien7-Mar-11 9:12
Maximilien7-Mar-11 9:12 
AnswerRe: Small IVR Development PinPopular
Chris Meech7-Mar-11 9:46
Chris Meech7-Mar-11 9:46 
GeneralRe: Small IVR Development Pin
Eytukan10-Mar-11 4:47
Eytukan10-Mar-11 4:47 
AnswerRe: Small IVR Development Pin
VBVoice9-Mar-11 4:41
VBVoice9-Mar-11 4:41 
GeneralRe: Small IVR Development Pin
AmbiguousName12-Mar-11 4:14
AmbiguousName12-Mar-11 4:14 
GeneralRe: Small IVR Development Pin
VBVoice14-Mar-11 3:42
VBVoice14-Mar-11 3:42 
Questionmemory mapped Pin
sarfaraznawaz7-Mar-11 1:35
sarfaraznawaz7-Mar-11 1:35 
AnswerRe: memory mapped Pin
Niklas L7-Mar-11 1:41
Niklas L7-Mar-11 1:41 
GeneralRe: memory mapped Pin
sarfaraznawaz8-Mar-11 20:37
sarfaraznawaz8-Mar-11 20: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.