SmsReadMessage

Send Feedback

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,
  __out_bcount(dwBufferSize) BYTE* const pbBuffer,
  DWORD dwBufferSize,
  __out_bcount(dwProviderSpecificDataBuffer) BYTE* const pbProviderSpecificBuffer,
  DWORD dwProviderSpecificDataBuffer,
  DWORD* pdwBytesRead
);

Parameters

  • smshHandle
    An Short Message Service (SMS) handle obtained from calling SmsOpen.
  • psmsaSMSCAddress
    Indicates the Short Message Service Center (SMSC) the message was routed through.
  • psmsaSourceAddress
    The source of the message.
  • pstReceiveTime
    The time of day that the message was received. This timestamp is in UTC (Coordinated Universal Time) format.
  • pbBuffer
    The data buffer used to store the received SMS message.
  • dwBufferSize
    Size, in bytes, of the buffer used for the received message. The buffer size to use can be determined by calling SmsGetMessageSize.
  • pbProviderSpecificBuffer
    For certain providers, a provider-specific buffer must be provided in addition to the previous data buffer.
  • dwProviderSpecificDataBuffer
    Size of pbProviderSpecificBuffer.
  • pdwBytesRead
    Number of bytes read. Includes incoming addresses, timestamps, and contents of buffers.

Return Values

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

  • S_OK
    The method completed successfully.

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

Remarks

If 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.

Requirements

Smartphone: Smartphone 2002 and later
Pocket PC: Pocket PC 2002 and later
OS Versions: Windows CE 3.0 and later
Header: sms.h
Library: sms.lib

See Also

Short Message Service Functions | SmsGetMessageSize | IMailRuleClient

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.