Hi,
I'm trying to implement rudimentary support for beaming using the Exchange
Manager. In my PilotMain I evaluate the launch command and act accordingly.
When I catch sysAppLaunchCmdExgReceiveData I need to open my database to
store the incoming data. Chances are it's open already - at the moment I'm
testing using loopback so it's guaranteed to be open already.
But I need to get a reference to it, so I call DmOpenDatabaseByTypeCreator,
passing it dmModeReadWrite as the mode to open it in.
For some reason it's failing - returning a NULL DmOpenRef. Calling
DmGetLastErr reports 0x216, which seems to correspond to
dmErrAlreadyOpenForWrites (dmErrorClass | 22). The same function is used to
open the database each time (ie during "normal" execution and when handling
Exchange codes.
Thus, questions:
1. There's a flag dmModeExclusive which I'm *not* setting anywhere. Does
this not mean I'm opening the database for non-exclusive access?
2. If I must open it exclusively, is there any way of getting a DmOpenRef to
the already open database, ie the "main" instance?
3. When exiting from PilotMain after handling sysAppLaunchCmdExgReceiveData,
should I close the database? I'd imagine so, if I've opened it twice so to
speak, but at the moment I can only open it once!
Apologies if I'm overlooking something obvious. It's 5:40AM local time and I
haven't gotten any sleep.
TIA,
Paul Gargan.