Home > Archive > Smartphone Developer Forum > May 2005 > Errors by using SHLoadImageFile
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Errors by using SHLoadImageFile
|
|
|
| Hi all:
I wrote a demo: Playing some frames(per frame is a separate
gif-format file) by Creating a thread,and using SHLoadImageFile to load
the gif images ,then Bitblt it to hdc.But the demo will be shut down
after playing almost 70 frames.
Maybe memory overflow??or resources go out??
Maybe SHLoadImageFile is not so robust in windows CE??
who can help me? thanks a lot!
//------------------------------------------------------//
//load one frame
HBITMAP lpImage = SHLoadImageFile(m_TotalPathName);
SelectObject(g_BmpMemDC,lpImage);
BitBlt(hdc,0,0,176,144,g_BmpMemDC,0,0,SR
CCOPY);
DeleteObject(lpImage);
//------------------------------------------------------//
| |
| Alex Feinman [MVP] 2005-05-26, 4:01 pm |
| You really should store the return value from SelectObject and then select
the old object back into DC before deleting your bitmap. You should not
delete an object currently selected into a DC.
--
Alex Feinman
---
Visit http://www.opennetcf.org
"vcfly" <cxzang@hotmail.com> wrote in message
news:1117129679.243441.169880@g49g2000cwa.googlegroups.com...
> Hi all:
> I wrote a demo: Playing some frames(per frame is a separate
> gif-format file) by Creating a thread,and using SHLoadImageFile to load
> the gif images ,then Bitblt it to hdc.But the demo will be shut down
> after playing almost 70 frames.
> Maybe memory overflow??or resources go out??
> Maybe SHLoadImageFile is not so robust in windows CE??
> who can help me? thanks a lot!
> //------------------------------------------------------//
> //load one frame
> HBITMAP lpImage = SHLoadImageFile(m_TotalPathName);
> SelectObject(g_BmpMemDC,lpImage);
> BitBlt(hdc,0,0,176,144,g_BmpMemDC,0,0,SR
CCOPY);
> DeleteObject(lpImage);
> //------------------------------------------------------//
>
| |
|
| vcfly wrote:
> Hi all:
> I wrote a demo: Playing some frames(per frame is a separate
> gif-format file) by Creating a thread,and using SHLoadImageFile to load
> the gif images ,then Bitblt it to hdc.But the demo will be shut down
> after playing almost 70 frames.
> Maybe memory overflow??or resources go out??
> Maybe SHLoadImageFile is not so robust in windows CE??
> who can help me? thanks a lot!
> //------------------------------------------------------//
> //load one frame
> HBITMAP lpImage = SHLoadImageFile(m_TotalPathName);
> SelectObject(g_BmpMemDC,lpImage);
> BitBlt(hdc,0,0,176,144,g_BmpMemDC,0,0,S
RCCOPY);
> DeleteObject(lpImage);
> //------------------------------------------------------//
>
this might help:
http://groups-beta.google.com/group...0652af18e3eae1e
riki
main(){printf("%d != %d, why?", sizeof('"')["'"],(sizeof('"'))["]\"\0["]);}
By Night:
ThemeChanger for Smartphone : http://homepages.inspire.net.nz/~gambit/
AbstractStart for Smartphone :
http://homepages.inspire.net.nz/~gambit/AbstractStart/
By Day: http://www.EmbeddedFusion.com
| |
|
| Well ,It's done,thanks a lot!
|
|
|
|
|