[missing-sync-palmos-dev-talk]
Problems creating Palm Databases with MissingSync
Dan Fletcher
dan at dogmelon.com.au
Thu Jun 2 16:34:37 PDT 2005
I'm having some problems with conduits when they try and create databases
on the Palm.
First some background:
I'm trying to port the NoteStudio conduit from Windows to Mac. This is
quite a complicated conduit, that can sync multiple networked computers,
and uses multiple databases on the Palm. These database names are
dynamically named, so their names aren't known at compile time.
I'm using XTools 1.5, installed on an iBook g4 with OSX 10.3.9, using the
Cocoa MemoPad demo provided on the MarkSpace website, linking against the
10.2.8 SDK and Palm CDK 4.0.3, and I'm using Missing Sync version 4.0.5
(v63)
Fortunately the conduit was initially designed on windows with the sync
logic and the setup separated, so I thought porting it should be quite
easy. The first thing I tried was just retrofitting the demo conduit with
our code. It compiled and linked ok, but whenever it tried to create a
database, a "funny" database would be created instead. It would have the
correct creatorID, but everything else would be wrong. The name would be
rubbish(Looking at the filename in a hex editor, it would be ascii code
08), the type field would contain rubbish, etc.
So I tried just doing the create DB code in the demo conduit. Same effect.
So I tried copy and pasting the create db code from the demo itself, just
to make it create the file. Same effect!
The original code compiled on windows, and the other code came from the
demo, so I don't think the code is the problem. But just in case, the code
is like this (Pasted in the demo just above: // Grab the memo pad data for
the current user.)
CDbCreateDB createInfo;
createInfo.m_FileHandle = 0;
createInfo.m_Creator = 'DMWI';
createInfo.m_Flags = (eDbFlags) (eRecord | eBackupDB);
createInfo.m_CardNo = 0;
memset(createInfo.m_Name,SYNC_DB_NAMELEN,0);
strcpy(createInfo.m_Name, "aa_dan");
createInfo.m_Type = 'DATA';
createInfo.m_Version = 0;
createInfo.m_dwReserved = 0;
syncErr = [mSyncMgr createDB:createInfo];
if (syncErr == SYNCERR_NONE)
{
syncErr = [mSyncMgr closeDB:mDbHandle];
}
return 0;
It looks like everything else works, just not creating databases. Any ideas
about what I could be doing wrong?
I'm copying the created plugin files into /Library/Application Support/Palm
HotSync/Conduit directory. I know the conduit is being run correctly,
because Log statements I add are shown in the Hot Sync log.
A few other questions that came up whilst I was doing this.
1) Is it a requirement to link against the 10.2.8 SDK? I didn't have this
at first, so I was linking against the current OS SDK. Since then I've
downloaded the 10.2.8 SDK, and link against that instead, but it doesn't
seem to make any difference.
2) Do the original Palm CDK API calls still work? Can I call SyncCreateDB,
or should I call [mSyncManager createDB] ? I've tried both, with no
apparent change. I'd rather call SyncCreateDB if I can, because it won't
require any code changes...
3) What exactly is the Remote Database Names list in the ConduitInfo.plist
file used for? Can the conduit create databases NOT in that list? There is
no way for us to know all the database names at compile time, so hopefully
this isn't a requirement.
Any feedback would be very welcome. I've just about reached the limit of
ideas that I can think ok. I'm guessing it isn't the code, and is more
likely the project (or even the iBook) setup, but I'm using the initial
demo project, so it should be fine. In fact, I've just re-downloaded it to
make sure I was using a clean, unaltered project, but no luck :(
Dan Fletcher
dogMelon Pty Ltd
_______________________________________________________
Dan Fletcher
dogMelon Pty Ltd
Note Studio:
A Powerful Note Taking system for your PC.
Try a free demo today at http://www.dogmelon.com.au/nspc
More information about the missing-sync-palmos-dev-talk
mailing list