Does anyone know how to delete/remove or resize an AppInfo or SortInfo Block
(without getting a FreeHandle error)?
If I have a AppInfo Structure like:
typedef struct{
UInt32 numOfItems;
Char Data;
}AppInfoType;
... and then I create my appInfo block
StrCopy(s, "Ryan");
appInfoSize = sizeof(AppInfoType) + StrLen(s);
DmNewHandle(dbRef, appInfoSize);
appInfoID = MemHandleToLocalID(h);
DmSetDatabaseInfo(cardNo, dbID, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
&appInfoID, NULL, NULL, NULL);
// ...but now I want to remove or resize it, even though palm gives us
DmNewHandle, they do not give us any other Dm Handle function like the Mem
handle functions. So I can't just DmHandleFree(appInfoH), or
DmHandleResize(appInfoH)...
//When I try :
appInfoH = (MemHandle) MemLocalIDToGlobal(appInfoID, cardNo);
MemHandleFree(appInfoH);
//then set it using DmSetDatabaseInfo, I get the dreaded FreeHandle fatal
error!
SO... unless someone has some ideas or can point out somthing I am missing,
I guess we can't delete or resize appInfo or sortInfo Blocks with out
deleting the database and re-creating it, which would be a hassle or just
not worth the trouble. Maybe Palm did not intend for us to use the app &
sort info blocks this way.
One more note: I have successfully been able to convert the appInfoID to a
Handle and use MemHandleFree (just as I did above) but I immediate create
another one (sortInfo) of a different size and set it right away using
DmSetDatabaseInfo... I have seen a freeHandle error occassionally with this
method, but seems to work most of time.... BUT this is what bothers me. And
eventhough this seems to let me resize the block and cannot delete (get rid
of it) it.
Any Ideas?
Thanks
-=Ryan Andersen
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/support/forums/