that may be because you're only copying the header.... (and not the complete one at that) ---- Best Regards, Dmitry Grinberg (847) 226 9295
On Thu, Feb 26, 2009 at 8:06 AM, Ryan Rix <[email protected]> wrote: > Hey guys, > > I am writing code to dynamically draw icons for an application launcher. > I am using a linked list to store all of the entries of the launcher, which > include both tAIB resource bitmaps (which are just BitmapType written to a > resource, right?) and generic BitmapTypes, all stored as pointers in my node > structure as a BitmapPtr icon. > > When I attempt to copy the resource to a static location in memory using > > newLink->icon=MemPtrNew( sizeof(BitmapType)); > DmOpenRef ref=DmOpenDatabase(cn,id,dmModeReadWrite); > MemHandle h = DmGetResource( 'tAIB', 1000 ); > if(h){ > BitmapPtr oldIcon = MemHandleLock(h); > MemMove(newLink->icon, oldIcon, sizeof(BitmapType)); > MemHandleUnlock(h); > }else{ > newLink->icon=NULL; > } > DmReleaseResource(h) > > I usually get crap written to the BitmapPtr and when I draw it with > WinDrawBitmap I usually get either a crash or just crap drawn to the screen, > I've yet to get a working icon. > Does anyone have a clue why my code keeps crapping out like this? > > -- > Thanks and best regards, > Ryan Rix > TamsPalm - The PalmOS Blog > (623)-239-1103 <-- Grand Central, baby! > > Jasmine Bowden - Class of 2009, Marc Rasmussen - Class of 2008, Erica > Sheffey - Class of 2009, Rest in peace. > > -- > For information on using the ACCESS Developer Forums, or to unsubscribe, > please see http://www.access-company.com/developers/forums/ -- For information on using the ACCESS Developer Forums, or to unsubscribe, please see http://www.access-company.com/developers/forums/
