I already tryied but it doesn't change. Thank you anyway. I fixed the problem using handles instead of pointers for the dc, but I really don't understand why it happens.
k
Posts
-
ReleaseDC doesn't release memory -
ReleaseDC doesn't release memoryI had problems using GetDC and ReleaseDC, so I built a blank MFC app like this:
BOOL CTestdcDlg::OnInitDialog() { CDialog::OnInitDialog(); // Set the icon for this dialog. The framework does this automatically // when the application's main window is not a dialog SetIcon(m_hIcon, TRUE); // Set big icon SetIcon(m_hIcon, FALSE); // Set small icon CenterWindow(GetDesktopWindow()); // center to the hpc screen // TODO: Add extra initialization here **SetTimer(1,200,NULL);** return TRUE; // return TRUE unless you set the focus to a control } void CTestdcDlg::OnTimer(UINT nIDEvent) { // TODO: Add your message handler code here and/or call default CDC *myDC; switch(nIDEvent) { case 1: **myDC=GetDC(); ReleaseDC(myDC);** break; } CDialog::OnTimer(nIDEvent); }
The memory used by this application increases continuously. What am I missing? This issue is causing me a lot of problems, do you ever encountered a problem like this? Thanks, Keraam