ok i further tweaked out the code...howeveer the emulatro crashes on the
following line.. this is when i retrieve the bitmap from the data base, in
the debugger non of these values that are sent to WinDrawBitmap are null.
following this is my function....


if (gBitmapPtr)
                WinDrawBitmap( gBitmapPtr, theBounds.topLeft.x,
theBounds.topLeft.y );


Err     RetrieveBitMap()
{
         
    Err                 theError;
    UInt16              theIndex = 0;
    MemHandle   theRecHandle;
    void *              theRecPtr;
    UInt32              theSize;
        RectangleType   theBounds;
        
        GetSignatureGadgetBounds( &theBounds );
         // create it.  This database will be used to store the bitmap.
                        gBitmapDB = DmOpenDatabaseByTypeCreator(DB_TYPE,
DB_CREATOR, dmModeReadWrite);
                        if (!gBitmapDB)
                        {
                                // Create the database
                                theError = DmCreateDatabase(0, DB_NAME,
DB_CREATOR, DB_TYPE, false);
                                if (theError) return theError;
                
                                // Then open it
                                gBitmapDB =
DmOpenDatabaseByTypeCreator(DB_TYPE, DB_CREATOR, dmModeReadWrite);
                                if (!gBitmapDB) return (1);
                        }
                        else
                        {
                                // Try to find an existing bitmap.  If one
exists, then use that
                                // as the default bitmap;
                                if (DmNumRecords( gBitmapDB ) > 0)
                                {
                                        // Grab out database record and lock
it down if it exists
                                        theRecHandle = DmGetRecord(
gBitmapDB, theIndex );
                                        if (theRecHandle)
                                        {
                                                theRecPtr = MemHandleLock(
theRecHandle );
                                                // Copy the data from the
record into the bitmap pointer global
                                                theSize =
MemPtrSize(theRecPtr);
                                                gBitmapPtr = MemPtrNew(
theSize );
                                                MemMove( gBitmapPtr,
theRecPtr, theSize );
                                        // Finally, unlock the record handle
                                                MemHandleUnlock(
theRecHandle );
                                        }
                                }
                        }
                if (gBitmapPtr)
                WinDrawBitmap( gBitmapPtr, theBounds.topLeft.x,
theBounds.topLeft.y );
                return theError;
}



what is casuing this to crash, and is there sample code for 3.5?

boaz

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/

Reply via email to