For Programmers: Free Programming Magazines  


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
vcfly

2005-05-26, 4:01 pm

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);
> //------------------------------------------------------//
>


riki

2005-05-26, 9:01 pm

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
vcfly

2005-05-27, 4:03 am

Well ,It's done,thanks a lot!

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com