hello, I am having problems with the releaseDC function in my application.
According to microsoft:
and in each sub I use it as follows:Remarks
The application must call the ReleaseDC function for each call to the GetWindowDC function and for each call to the GetDC function that retrieves a common DC.
VB Code:
public sub whatever() Dim hWndDesk As Long Dim hDCDesk As Long hWndDesk = GetDesktopWindow() hDCDesk = GetWindowDC(hWndDesk) ' do whatever in the sub 'right before the sub ends i release the DC that i got at the beginning of it Call ReleaseDC(hWndDesk, hDCDesk) end sub
But that doesnt seem to work, i still get a memory leak. In the sub of the app. that im having my issue in, the only thing i do using the DC is use the getpixel function. So, does that mean everytime i use the getpixel function i should use the releasedc function after it? Thanks




Reply With Quote