CMessageStore::GetMessageCount Method  
 
BOOL GetMessageCount(
  LPLONG lpnLastMessage  
);

The GetMessageCount method returns the number of messages in the current message store.

Parameters

lpnLastMessage
A pointer to an integer which will contain the message number for the last message in the storage file. If this information is not required, a NULL pointer may be specified.

Return Value

If the method succeeds, the return value is the number of messages in the message store. If the method fails, the return value is MIME_ERROR. To get extended error information, call GetLastError.

Remarks

The GetMessageCount method returns the number of messages in the message store. It is important to note that does not count those messages which have been marked for deletion. This means that the value returned by this function will decrease as messages are deleted.

The message number returned in the lpnLastMessage parameter will specify the total number of messages in the message store, including deleted messages.

Requirements

Minimum Desktop Platform: Windows 7 (Service Pack 1)
Minimum Server Platform: Windows Server 2008 R2 (Service Pack 1)
Header File: cstools10.h
Import Library: csmsgv10.lib
Unicode: Implemented as Unicode and ANSI versions.

See Also

DeleteMessage, FindMessage, GetMessage