Why don't you use DmGetResource? that's the easier and official way.
h = DmGetResrouce(bitmapRsc, myID);
bmp = MemHandleLock(h);
WinPaintBitmap(bmp, r.topLeft.x, r.topLeft.y);
The reason your way isn't working is probably due to the fact that PACE puts
some shadow structures between you and the OS.
Hrm next time don't waste your time reading tons of messages, just go
straight to the Palm OS Developer's Compaion in the official documentation.
"PDB File" -- they are called databases. there isn't a file system on Palms
like you imagine for PC Hard Disks.
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Michael
Yokoyama
Sent: Monday, June 21, 2004 2:07 AM
To: Palm Developer Forum
Subject: Palm OS displays BMPs stored in a PDB
As far as my research reading hundreds of back posts on the Lyris server
goes, I don't think this topic was ever answered.
I have saved BMPs to a PDB file. Having done that, I want to display
the BMPs from the PDB file. I created the PDB file with PilRC. An
Internet utility pdbdump.exe allowed me to verify that the PDB was
created ok. (I think its ok).
Now the task is to display the BMP data from the PDB file using
WinDrawBitmap. My code looks like this:
Void DisplayBMP(Int BitmapNum)
{
VoidHand hBitmap;
BitmapPtr p;
DmOpenRef gDB = 0;
gDB = DmOpenDatabaseByTypeCreator('data','A123', dmModeReadOnly);
if (gDB) {
hBitmap = DmQueryRecord(gDB, BitmapNum);
if (hBitmap) {
p = (BitmapPtr) MemHandleLock (hBitmap);
WinDrawBitmap (p, x, y);
MemPtrUnlock(p);
DmCloseDatabase(gDB);
}
}
The above code crashes at p = (BitmapPtr) MemHandleLock (hBitmap). Note
here error cases have been omitted for brevity.
There are numerous examples of source code for reading PDB files on the
Internet - the problem is all of them I have seen so far are for the
Microsoft Windows environment. Give Palm OS a hand....
Michael Yokoyama
Palm Powered Expert Guide - Japan
Mountainside Productions
Click here to study Japanese! > KanjiKun1 at Mountainside Productions
--
For information on using the Palm Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/support/forums/
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/support/forums/