> From: Stephen A. Cochran
>
> status =
> (BitmapPtr)DmGetResource(bitmapRsc, UnreadIconBitmap);
> ...
> if (status)
> {
> WinDrawBitmap(status, 0, bounds->topLeft.y);
> }
>
DmGetResource returns a MemHandle, not a BitmapPtr!
You have to lock the handle to get a pointer, then draw the bitmap, then
unlock the handle, then release the resource.
Here is some sample code (untested but most likely functional):
MemHandle theResourceHandle;
BitmapPtr theBitmapPtr;
theResourceHandle = DmGetResource( bitmapRsc, bitmapID );
if (theResourceHandle)
{
theBitmapPtr = (BitmapPtr)MemHandleLock( theResourceHandle );
if (theBitmapPtr)
{
WinDrawBitmap( theBitmapPtr, x, y );
MemHandleUnlock( theResourceHandle );
}
DmReleaseResource( theResourceHandle );
}
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/