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

C / C++ / MFC

 
AnswerRe: How to deselct the text from a rich edit control when i click ( not click and move ) in the text of it. Pin
Hans Dietrich8-Mar-11 1:09
mentorHans Dietrich8-Mar-11 1:09 
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 
your code is hard to read without proper formatting (pre tags are your friends Smile | :) ), but as i see it here:

leorex wrote:
for(i_row=0; i_row<17; i_row++)
{
for(j_column=0; j_column<7; j_column++)
{
hBrush_1 = CreateSolidBrush(color[i_row][j_column]);
holdBrush = 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

}
}

you create a new brush in every iteration, but you will delete only the very last one, all the rest just leaks away happily. Also, in every iteration you overwrite the value of holdbrush, thus, unless you make exactly 1 iteration, you won't know the original brush and won't be able to select it back into the DC when you are done.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> //TODO: Implement signature here<

GeneralRe: program leaks memory when i resize Pin
leorex9-Mar-11 0:14
leorex9-Mar-11 0:14 
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 

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.