Once your environment is all set up, now we can try out a test conduit to make sure all is well. If so, you will be ready to start developing your own conduits.
A good test conduit called "SimpleDB" is provided as a sample with the CDK. This is an example of a conduit that interacts with memos. Rather than syncing your memos between Palm and Desktop, this one will display a form and allow you to search for the count of memos that include a certain word. Possibly not the most useful thing to do, but if it works you will know your conduit development is ready for you to use to make something that is the most useful thing to do.
To make alert the hotsync program of the existence of a new conduit, you must register it to be run. You can do this with the CondCfg.exe program that is in the common/bin folder of your CDK install - e.g. at C:\Program Files\PalmSource\Palm OS CDK\Common\Bin if the defaults are used. Close any hotsync programs that might be open, and run that file.
Default condcfg info for memo conduitYou will see a list of user conduits. Each conduit is associated with a unique creatorID; this is the same ID that the relevant database file on your Palm will be tagged with. There can only be one conduit per creatorID.
As SimpleDB deals with the memos application, we can use the conduit with the memo creatorID. Look down the list for the existing entry with the "memo" creatorID. Click on it, and choose details. This gives you information about the current configuration of the conduit. Unless you have installed any programs that have changed it, this will be the conduit that syncs your memos before the Palm and the PC. After modifying it now, you will want to replace the original conduit, so be sure to right down all the details shown on this screen so you can re-enter the exact information to restore the default conduit after this experiment.
Once you have noted the existing information down, click Cancel to go to the previous screen. Ensure this memo conduit is still highlighted, and press Delete and confirm you wish to delete it. Now choose Add.
In the resulting screen, fill in the following information. At the bottom, choose "COM based conduit" as this is the technology we use to interact with Visual Basic 6. In the Com Client dropdown box, browse to select the path of the Visual Basic application. By default, this is likely to be C:\Program Files\Microsoft Visual Studio\VB98\VB6.exe.
Back at the top, the filename should have set itself to ComConduit.dll already. Fill in the Creator ID below with "memo". SimpleDB just queries existing data, so we can leave all the data dirs, files, etc. settings blank. Set "Display Name" to SimpleDB.
Click OK. You have now told Hotsync manager that when it comes to time to synchronise your memos, you want to run the COM Client, i.e. Visual Basic 6 itself.
Start Hotsync manager, by running the Hotsync.exe file in the CDK Common/Bin folder. If you right click it and go to custom, you should be able to see your "SimpleDB" conduit in it. Note that if there are any other conduits that interact with memos in this list, you may have to set them to "Do Nothing" for this to work. Close the Custom hotsync box.
HotSync your Palm. When it reaches the point where it normally would sync your memos, Visual Basic 6 should load up and the sync process will pause. In the VB6 environment, open the project SimpleDB.vbp installed by CDK which is found, by default, in C:\Program Files\PalmSource\Palm OS CDK\COM\Samples\ClassicDB\Tutorial\SimpleDb. You can browse its code to see what it does at your leisure. However it will only actually run during the middle of the Hotsync process that we are now in.
The SimpleDB formYou might like to note that this project contains the following references to Palm libraries:
- Palm OS Classic Databases
- Palm OS Classic Databases and Utilities
These are references you likely will want to use in your own conduits in order to manipulate Palm data easily. Do this via choosing the Project menu, then References, and ticking the relevant boxes.
Still within the VB environment, run the Project by pressing F5 (or going to Run menu, then start). You should see a form come up. Type a word into the box and click search. It will tell you how many of your memos contain that word. Close the program and the whole VB environment, and the Palm will carry on syncing with any other conduits that remain.
If all has worked, congratulations, you are ready to start developing conduits! Alternatively, if you are done for now, you may want to put everything back such that your memos conduit syncs the memos to the PC rather than loads VB. To do this use the CondCfg program to delete the conduit with creatorID "memo" that you previously created, and add a new one with the same creatorID but with the settings of the original that you wrote down at the start of this experiment.

Comments
Post new comment