Click here to Skip to main content
15,916,945 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionBest Approach? Pin
monrobot135-May-04 10:18
monrobot135-May-04 10:18 
AnswerRe: Best Approach? Pin
Christian Graus5-May-04 10:35
protectorChristian Graus5-May-04 10:35 
AnswerRe: Best Approach? Pin
Antti Keskinen5-May-04 10:37
Antti Keskinen5-May-04 10:37 
GeneralDynamic Menus w/ MDI Pin
BAmity5-May-04 9:26
BAmity5-May-04 9:26 
GeneralRe: Dynamic Menus w/ MDI Pin
Roger Allen6-May-04 4:30
Roger Allen6-May-04 4:30 
GeneralWM_COPYDATA Pin
Anonymous5-May-04 8:12
Anonymous5-May-04 8:12 
GeneralRe: WM_COPYDATA Pin
David Crow5-May-04 8:49
David Crow5-May-04 8:49 
QuestionMemory leaks? Pin
jonsson_845-May-04 7:53
jonsson_845-May-04 7:53 
I'm writing a MFC program in Visual Studio 6.0. When I run it on my Windows XP cumputer it works great, but if I try it on my other computer with Windows 98 the program starts to "eat" memory at a very fast rate.

I have traced the problem to the following function (if I comment it out the program stops using up all the memory on the Windows 98 computer)


CClientDC dc(this);

CDC buffer;
buffer.CreateCompatibleDC(&dc);

CBitmap bitmap;
bitmap.CreateCompatibleBitmap(&dc, SKARM_BREDD, SKARM_HOJD);
buffer.SelectObject(&bitmap);

CBrush vit(RGB(255, 255, 255));
CRect rect(0, 0, SKARM_BREDD, SKARM_HOJD);
buffer.FillRect(&rect, &vit);

for(int i = 0; i < sidor.size(); i++)
{
buffer.MoveTo(skarmKoord.at(sidor.at(i).hornPunkter.at(0)));

for(int j = 1; j < sidor.at(i).hornPunkter.size(); j++)
buffer.LineTo(skarmKoord.at(sidor.at(i).hornPunkter.at(j)));

buffer.LineTo(skarmKoord.at(sidor.at(i).hornPunkter.at(0)));
}

dc.BitBlt(5, 5, SKARM_BREDD, SKARM_HOJD, &buffer, 0, 0, SRCCOPY);


Is it something wrong with this code?
AnswerRe: Memory leaks? Pin
David Crow5-May-04 7:57
David Crow5-May-04 7:57 
GeneralRe: Memory leaks? Pin
jonsson_845-May-04 8:07
jonsson_845-May-04 8:07 
GeneralRe: Memory leaks? Pin
David Crow5-May-04 8:52
David Crow5-May-04 8:52 
GeneralRe: Memory leaks? Pin
jonsson_845-May-04 10:45
jonsson_845-May-04 10:45 
AnswerRe: Memory leaks? Pin
Johan Rosengren5-May-04 8:23
Johan Rosengren5-May-04 8:23 
GeneralRe: Memory leaks? Pin
jonsson_845-May-04 8:42
jonsson_845-May-04 8:42 
QuestionActiveX C++ component for printing? Pin
TigerNinja_5-May-04 7:43
TigerNinja_5-May-04 7:43 
GeneralProper way to define global class objects Pin
georgiek505-May-04 7:34
georgiek505-May-04 7:34 
GeneralRe: Proper way to define global class objects Pin
David Crow5-May-04 7:55
David Crow5-May-04 7:55 
GeneralRe: Proper way to define global class objects Pin
georgiek505-May-04 8:38
georgiek505-May-04 8:38 
GeneralRe: Proper way to define global class objects Pin
Rick York5-May-04 10:40
mveRick York5-May-04 10:40 
GeneralRe: Proper way to define global class objects Pin
Antti Keskinen5-May-04 10:49
Antti Keskinen5-May-04 10:49 
GeneralRe: Proper way to define global class objects Pin
Anonymous5-May-04 11:40
Anonymous5-May-04 11:40 
GeneralRe: Proper way to define global class objects Pin
David Chamberlain6-May-04 6:03
David Chamberlain6-May-04 6:03 
GeneralInvoking BIOS and DOS INT's Pin
Tank_Aviator5-May-04 7:18
Tank_Aviator5-May-04 7:18 
GeneralRe: Invoking BIOS and DOS INT's Pin
Jeremy Falcon5-May-04 7:35
professionalJeremy Falcon5-May-04 7:35 
GeneralRe: Invoking BIOS and DOS INT's Pin
David Crow5-May-04 7:44
David Crow5-May-04 7:44 

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.