TransportCount

The TransportCount function determines the number of pending messages in the mailbox and returns this count in the lpNumMsgs parameter.

Syntax

BOOL TransportCount(HANDLE hService, LPWORD lpNumMsgs);

At a Glance

Header file: Smtp.h
Platforms: H/PC
Windows CE versions: 1.0 and later

Parameters

hService
Handle to a SERVICE structure.
lpNumMsgs
Pointer to receive the number of messages found in the mailbox.

Return Values

Returns TRUE if successful or FALSE otherwise. To get extended error information, call TransportError or TransportErrorMsg.

Remarks

The TransportCount function must be implemented by the transport service provider in a DLL registered as a mail service. The Inbox application can load this DLL and call TransportCount.

For the sample transport service, TransportCount searches the mail directory specified in the szMailDir member of the designated SERVICE structure and determines the number of message files present. It sets the values of the wNumMsgs and wHighNum members of the specified SERVICE structure accordingly. If lpNumMsgs is a valid pointer, it is set to the number of messages found. This value is also saved in the wNumMsgs member of the SERVICE structure.