Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 10.0.1 » MobiLink - Server-Initiated Synchronization » MobiLink Listener SDK for Palm » Message processing interface

PalmLsnFree function Next Page

PalmLsnDupMessage function


Initializes the message field values of an a_palm_msg instance.

Prototype

Err PalmLsnDupMessage(
struct a_palm_msg * const msg,
Char const * message
)

Parameters
Return Value

A Palm OS error code. errNone indicates success.

Remarks

The PalmLsnDupMessage function duplicates a text message, extracts the subject, content, and sender fields, and assigns these values to an a_palm_msg instance.

The sender field is not extracted if it does not appear in the message. If you use PalmLsnDupSender it overrides the sender field extracted from PalmLsnDupMessage (if any).

See also
Example

The following example, used for the Treo 600 smartphone implementation, retrieves a text message and calls PalmLsnDupMessage to initialize the appropriate fields in an a_palm_msg instance.

//
// Retrieve the entire message body
//
ret = PhnLibGetText( libRef, id, &msgBodyH );
if( ret != errNone ) {
    // handle error
    goto done;  
}
msgBody = (Char *)MemHandleLock( msgBodyH );
ret = PalmLsnDupMessage( ulMsg, msgBody );
//
// msgBodyH must be disposed of by the caller
//
MemHandleUnlock( msgBodyH );
MemHandleFree( msgBodyH );
if( ret != errNone ) {
  // handle error
  goto done;
}