Click here to Skip to main content
15,904,817 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: The Large Access Database ! Pin
Hadi Rezaee20-Nov-02 10:15
Hadi Rezaee20-Nov-02 10:15 
GeneralClipboard Question Pin
Nitron20-Nov-02 5:05
Nitron20-Nov-02 5:05 
GeneralRe: Clipboard Question Pin
User 988520-Nov-02 5:17
User 988520-Nov-02 5:17 
GeneralRe: Clipboard Question Pin
Nitron20-Nov-02 8:00
Nitron20-Nov-02 8:00 
GeneralRe: Clipboard Question Pin
User 988520-Nov-02 8:10
User 988520-Nov-02 8:10 
GeneralRe: Clipboard Question Pin
Nitron20-Nov-02 8:13
Nitron20-Nov-02 8:13 
GeneralRe: Clipboard Question Pin
User 988520-Nov-02 8:53
User 988520-Nov-02 8:53 
GeneralMemory Problems!!! Pin
Paddy20-Nov-02 5:04
Paddy20-Nov-02 5:04 
I hope someone can figure this one out for me!
I have a simple function that takes 400 double values and graphs them in the client area. I run this about 25 times per second to give 25 FPS. This works fine however it uses up all the memory in my computer after about ten minutes!!! In the "Windows Task Manager" the mem usage just keeps increasing until my computer crashes. I'm sure it is this function that is causing the problem because when I leave it out this doesn't happen.
Any ideas?


void function3 (HWND hwnd, double a[], int iLength)
{
HDC hdc;
PAINTSTRUCT ps;
int i;

hdc = GetDC(hwnd);

Rectangle(hdc, 0, 0, 400, 256);

MoveToEx(hdc, 0, 256, NULL);

for (i=1; i< 400; i = i++)
{
int p = (int)a[i];
LineTo(hdc, i, 255-p);
}

EndPaint (hwnd, &ps) ;
}


Thanks in advance,
Paddy
GeneralRe: Memory Problems!!! Pin
Rickard Andersson2020-Nov-02 5:11
Rickard Andersson2020-Nov-02 5:11 
GeneralRe: Memory Problems!!! Pin
Paddy20-Nov-02 6:43
Paddy20-Nov-02 6:43 
GeneralRe: Memory Problems!!! Pin
Nitron20-Nov-02 5:11
Nitron20-Nov-02 5:11 
GeneralRe: Memory Problems!!! Pin
Paddy20-Nov-02 6:44
Paddy20-Nov-02 6:44 
GeneralRe: Memory Problems!!! Pin
Nitron20-Nov-02 6:52
Nitron20-Nov-02 6:52 
GeneralRe: Memory Problems!!! Pin
Paddy20-Nov-02 8:28
Paddy20-Nov-02 8:28 
GeneralRe: Memory Problems!!! Pin
Ravi Bhavnani20-Nov-02 9:23
professionalRavi Bhavnani20-Nov-02 9:23 
GeneralPropertis Window Pin
ivexx20-Nov-02 4:27
sussivexx20-Nov-02 4:27 
GeneralMessage handler function being called multiple times Pin
Mohit Khanna20-Nov-02 3:55
Mohit Khanna20-Nov-02 3:55 
GeneralRe: Message handler function being called multiple times Pin
Alois Kraus20-Nov-02 4:17
Alois Kraus20-Nov-02 4:17 
GeneralRe: Message handler function being called multiple times Pin
Mohit Khanna20-Nov-02 18:29
Mohit Khanna20-Nov-02 18:29 
GeneralShellExecute w/ unknown filename parameter Pin
kubert20-Nov-02 3:25
kubert20-Nov-02 3:25 
GeneralRe: ShellExecute w/ unknown filename parameter Pin
Simon.W20-Nov-02 3:38
Simon.W20-Nov-02 3:38 
GeneralGetting float by reference- low performance Pin
Member 887120-Nov-02 3:02
Member 887120-Nov-02 3:02 
GeneralRe: Getting float by reference- low performance Pin
Simon.W20-Nov-02 3:17
Simon.W20-Nov-02 3:17 
GeneralRe: Getting float by reference- low performance Pin
User 988520-Nov-02 8:56
User 988520-Nov-02 8:56 
GeneralRe: Getting float by reference- low performance Pin
User 988520-Nov-02 8:57
User 988520-Nov-02 8:57 

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.