Hi
I have been having a little trouble with the call DmRecordInfo, from the doco I believe that uniqueIDP should return a "unique" value, this code doesnt it is always the same value, which obviously isnt "unique".
This must be something simple but I cannot get past this problem.
Any one got any ideas ?
Ptr pRec;
VoidHand memoRec;
Err error;
UInt mode;
DmOpenRef MemoPadDB;
UInt32 memoPadDBType = 'DATA';
UInt16 index;
UInt32 uniqueIDP = 0;
VoidHand memoRec;
Err error;
UInt mode;
DmOpenRef MemoPadDB;
UInt32 memoPadDBType = 'DATA';
UInt16 index;
UInt32 uniqueIDP = 0;
mode = dmModeReadWrite;
MemoPadDB = DmOpenDatabaseByTypeCreator(memoPadDBType, sysFileCMemo ,mode); //memoPadDBType is 'DATA'
// Get index of new memo record to be added.
index = 0; // befinning of DB
// Create a new record in the database
memoRec = DmNewRecord(MemoPadDB, &index, StrLen(data) + 1);
// Lock down the block containing the new record.
pRec = (Char*)MemHandleLock(memoRec);
DmStrCopy (pRec, index , data);
// Unlock the block of the new record.
error = MemPtrUnlock(pRec);
if (error != 0)
return error;
error = DmReleaseRecord (MemoPadDB, index, true);
if (error != 0)
return error;
error = DmRecordInfo( MemoPadDB, index, NULL, &uniqueIDP, NULL);
if (error != 0)
return error;
// Debug -> display the value, always 16
gUniqueIDP = uniqueIDP;
char buf[32];
//send received data to display
StrPrintF(buf,"gUniqueIDP: %i", gUniqueIDP);
FrmCustomAlert
(
DebugScreenAlert ,
"No error on create of memo",
"gUniqueIDP",
buf
);
// Close the application's database.
DmCloseDatabase(MemoPadDB);
char buf[32];
//send received data to display
StrPrintF(buf,"gUniqueIDP: %i", gUniqueIDP);
FrmCustomAlert
(
DebugScreenAlert ,
"No error on create of memo",
"gUniqueIDP",
buf
);
// Debug -> display the value, always 16
// Close the application's database.
DmCloseDatabase(MemoPadDB);
I have tried the DmRecordInfo before the release as well, but no joy :(
Thanks for your help in advance.
NG
--
Enjoy the experience of software from downunder that keeps you on top.
..-_|\ Nigel Grant
/ OZ \ GPO Box 985
\ _.--._ / Canberra
v 2601
.) .)
http://geocities.com/ngrant_com
Smile its free
--
For information on using the PalmSource Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
--
Enjoy the experience of software from downunder that keeps you on top.
..-_|\ Nigel Grant
/ OZ \ GPO Box 985
\ _.--._ / Canberra
v 2601
.) .)
http://geocities.com/ngrant_com
Smile its free
