PalmLsnDupMessage method

Initializes the message field values of an a_palm_msg instance.

Syntax
Err PalmLsnDupMessage(
    struct a_palm_msg * const msg,
    Char const * message
)
Parameters
  • msg   A pointer to an a_palm_msg instance.

  • message   An input parameter containing the source message text.

Returns

A Palm OS error code. errNone indicates success.

Remarks

The PalmLsnDupMessage method 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 650 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;
}