> I'm having this odd problem with ExgConnect while running on an emulated
> Palm OS 4.0 m505 device (it happens on a real 4.0 device too, a Sony
610C).
> This API always returns the bad status 0x150F, "Operation not supported".

That's right. The IrOBEX exchange library doesn't support the ExgConnect
function. You don't need it though. To send multiple objects, use these
steps:

- zero out socket
- set socket to contain meta-data for first object
- ExgPut
- if ExgPut succeeded then
        - ExgSend, repeating as necessary
        - loop through remaining objects
                - set socket to contain meta-data for current object
                - ExgPut
                - if ExgPut succeeded then
                        - ExgSend, repeating as necessary
                - else
                        - break out of loop
        - ExgDisconnect, passing error code, if any
- else
        - report error, if desired

The call to ExgDisconnect must be conditional on the success of the first
call to ExgPut. Not pretty, but it works.

For a more readable account, see the Companion, volume 2, Object Exchange,
Sending Data, Sending Multiple Objects.

> If I do that same thing, but before the ExgDisconnect I do multiple
> ExgPut/ExgDBWrite calls (one per bundled database, exgSocket.count set
> correctly before hand) in a loop controlled by
> DmGetNextDatabaseByTypeCreator, that API call returns the first couple
> databases just fine, but then begins returning the same database multiple
> times, though I'm calling it with newSearch = false after the first call,
> and onlyLatestVers set to true every time!

This is a classic "modifying a collection as you iterate over it" bug. The
IrOBEX exchange library uses file streams to buffer outgoing objects. These
are really just databases with a bit set to indicate that they represent
files. The way the launcher gets around this problem is by building a list
of bundled databases in advance.

You should probably include overlays, even if they don't have the bundle bit
set. Overlays built with the Palm OS 3.5 SDK don't have the bundle bit set.
--
Danny @ PalmSource

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/

Reply via email to