VoyForums
[ Show ]
Support VoyForums
[ Shrink ]
VoyForums Announcement: Programming and providing support for this service has been a labor of love since 1997. We are one of the few services online who values our users' privacy, and have never sold your information. We have even fought hard to defend your privacy in legal cases; however, we've done it with almost no financial support -- paying out of pocket to continue providing the service. Due to the issues imposed on us by advertisers, we also stopped hosting most ads on the forums many years ago. We hope you appreciate our efforts.

Show your support by donating any amount. (Note: We are still technically a for-profit company, so your contribution is not tax-deductible.) PayPal Acct: Feedback:

Donate to VoyForums (PayPal):

Login ] [ Contact Forum Admin ] [ Main index ] [ Post a new message ] [ Search | Check update time | Archives: 1234567[8]910 ]


[ Next Thread | Previous Thread | Next Message | Previous Message ]

Date Posted: 17:41:44 06/04/01 Mon
Author: Michel
Subject: Re: Out of Virtual Memory
In reply to: Vivek 's message, "Re: Out of Virtual Memory" on 08:13:58 06/04/01 Mon


Hi Vivek,

I'm not sure if this is possible. When using direct api calls like your are doing, windows usually keeps it memory structures to itself, and gives you the bitmap handle.

Best regards,

Michel


>Dear Michel,
>Is there any way to access the perticular location in
>RAM where The Image is loaded and access it
>continousy, please reffer to my previous mail and
>code. In which I display 2 images simultaniousy to
>have a animation.
>thanks and regards,
>
>Vivek Borkar
>
>>
>>Dear Vivek,
>>
>>The first thing I would do is get a hold of MemProof,
>>a free memory and resource leak checker. It checks for
>>memory and resource leaks.
>>
>>I think it is available from <a rel=nofollow target=_blank href="http://www.totalqa.com">http://www.totalqa.com</a>
>>
>>Best regards,
>>
>>Michel
>>>
>>>
>>>I'm getting this error "Out of virtual Memory", with
>>>my following code. I'm calling this function in Timer
>>>routine.
>>>
>>>void CTry2Dlg::DisplayBMP()
>>>{
>>>
>>> CString temp;
>>> BITMAP bit,bit1;
>>> int x,y;
>>> //CPaintDC dc(this);
>>> CClientDC dc(this);
>>> HDC hdc,temp_hdc,temp_hdc1;
>>> hdc = dc.GetSafeHdc();
>>>
>>> if(toggle)
>>> {
>>>
>>> temp_hdc = CreateCompatibleDC(hdc);
>>>
>>> m_Hbitmap =
>>>(HBITMAP)LoadImage(AfxGetInstanceHandle(),
>>>"D:\\old_D\\vib\\bmpconvertion\\102.bmp",
>>>IMAGE_BITMAP, 684, 512,
>>>LR_LOADFROMFILE/*|LR_CREATEDIBSECTION*/);
>>> m_HbitmapNew =
>>>(HBITMAP)SelectObject(temp_hdc,m_Hbitmap);
>>> GetObject(m_Hbitmap,sizeof(BITMAP),&bit);
>>> x = bit.bmWidth;
>>> y = bit.bmHeight;
>>>
>>> BitBlt(hdc,0,0,x,y,temp_hdc,0,0,SRCCOPY);
>>> SelectObject(temp_hdc,m_HbitmapNew);
>>>
>>> DeleteObject(m_HbitmapNew);
>>> DeleteDC(temp_hdc);
>>> toggle = 0;
>>> }
>>> else
>>> {
>>> temp_hdc1 = CreateCompatibleDC(hdc);
>>>
>>> m_Hbitmap1 =
>>>(HBITMAP)LoadImage(AfxGetInstanceHandle(),
>>>"D:\\old_D\\vib\\bmpconvertion\\103.bmp",
>>>IMAGE_BITMAP, 684, 512,
>>>LR_LOADFROMFILE/*|LR_CREATEDIBSECTION*/);
>>> m_HbitmapNew1 =
>>>(HBITMAP)SelectObject(temp_hdc1,m_Hbitmap1);
>>>
>>> GetObject(m_Hbitmap1,sizeof(BITMAP),&bit1);
>>>
>>> x = bit1.bmWidth;
>>> y = bit1.bmHeight;
>>>
>>> BitBlt(hdc,0,0,x,y,temp_hdc1,0,0,SRCCOPY);
>>> SelectObject(temp_hdc1,m_HbitmapNew1);
>>>
>>> DeleteObject(m_HbitmapNew1);
>>> DeleteDC(temp_hdc1);
>>>
>>> toggle = 1;
>>> }
>>>
>>>}
>>>
>>>This routine toggles between displaying of two Images
>>>read from a file.
>>>
>>>Please help me out,
>>>
>>>Thanks,
>>>Vivek

[ Next Thread | Previous Thread | Next Message | Previous Message ]

[ Contact Forum Admin ]


Forum timezone: GMT-5
VF Version: 3.00b, ConfDB:
Before posting please read our privacy policy.
VoyForums(tm) is a Free Service from Voyager Info-Systems.
Copyright © 1998-2019 Voyager Info-Systems. All Rights Reserved.