MSDN Library

SmsReadMessage

Windows Mobile 6.5
A version of this page is also available for
4/8/2010

This function is used to read a previously received Short Message Service (SMS) message.


HRESULT SmsReadMessage (
  const SMS_HANDLE      smshHandle,
  SMS_ADDRESS* const    psmsaSMSCAddress,
  SMS_ADDRESS* const    psmsaSourceAddress,
  SYSTEMTIME* const     pstReceiveTime,
    bcount(dwBufferSize)  BYTE*  pbBuffer,
  DWORD                 dwBufferSize,
  bcount(dwProviderSpecificDataBuffer) BYTE* pbProviderSpecificBuffer,
  DWORD                 dwProviderSpecificDataBuffer,
  DWORD*                pdwBytesRead
);

smshHandle

[in]A Short Message Service (SMS) handle obtained from calling SmsOpen.

psmsaSMSCAddress

[in, out]Indicates the Short Message Service Center (SMSC) the message was routed through.

psmsaSourceAddress

[in]The source of the message.

pstReceiveTime

[in, out]The time of day that the message was received. This time stamp is in UTC (Coordinated Universal Time) format.

pbBuffer

[out]The data buffer used to store the received SMS message.

dwBufferSize

[in]Size, in bytes, of the buffer used for the received message. The buffer size to use can be determined by calling SmsGetMessageSize.

pbProviderSpecificBuffer

[out]For certain providers, a provider-specific buffer must be provided in addition to the previous data buffer.

dwProviderSpecificDataBuffer

[in]Size of pbProviderSpecificBuffer.

pdwBytesRead

[out]Number of bytes that were read. This includes only the message data. It does not include the incoming addresses or time stamp.

This method returns the standard values E_INVALIDARG, E_OUTOFMEMORY, E_UNEXPECTED, and E_FAIL, and the following:

S_OK

The method completed successfully.

For information about additional return values, see SMS Specific Errors.

If It Is Possible, use the IMailRuleClient to read SMS messages instead of SmsReadMessage. Using SmsReadMessage to read incoming messages may interfere with other MAPI clients and the Messaging (formerly Inbox) application.

Use SmsReadMessage when you want to replace Outlook Mobile for handling short messages, or you want to intercept a user-defined message type which is not handled by Outlook Mobile.

Headersms.h
Librarysms.lib
Windows Embedded CEWindows Embedded CE 6.0 and later
Windows MobilePocket PC 2002 and later, Smartphone 2002 and later

Community Additions

Show:
© 2016 Microsoft