I have this problem that I am sure is cause by this
It doesn't happen right away but after a bunch of compiles VB will give me an out of memory error. Any ideas why? Or is there away to be sure that while unloading that everything that is taking up memory gets released?Code:Dim SButtons As Long Dim SkinTop As Long Dim SBody As Long Dim hBitmap As BITMAP Dim ButtonsBitmap As BITMAP SButtons = CreateCompatibleDC(0) SkinTop = CreateCompatibleDC(0) SBody = CreateCompatibleDC(0) imgTemp = LoadImage(ByVal 0&, bmpName, 0, 0, 0, LR_LOADFROMFILE Or LR_CREATEDDIBSECTION) SelectObject SBody, imgTemp GetObjectAPI imgTemp, Len(hBitmap), hBitmap DeleteObject imgTemp BitBlt frmTechAmp.picBody.hdc, 0, 0, me.picBody.ScaleWidth, me.picBody.ScaleHeight, SBody, 0, 0, vbSrcCopy DeleteDC SButtons DeleteDC SkinTop DeleteDC SBody




Reply With Quote