CImapClient::GetCurrentMailbox Method  
 
INT GetCurrentMailbox(
  LPTSTR lpszMailbox,  
  INT nMaxLength  
);
INT GetCurrentMailbox(
  CString& strMailbox  
);

The GetCurrentMailbox method returns the name of the current mailbox that has been selected.

Parameters

lpszMailbox
A null-terminated string buffer that will contain the current mailbox name. If the application uses the Unicode character set, the mailbox name will automatically be converted from modified UTF-7 encoding to Unicode. If the application does not use Unicode, the mailbox name will be returned using modified UTF-7 encoding. An alternate form of the method accepts a CString object which will contain the mailbox name when the method returns.
nMaxLength
The maximum length of the mailbox string, including the terminating null character.

Return Value

If the method succeeds, it returns the length of the current mailbox name, not including the terminating null character. If an error occurs, the method returns IMAP_ERROR. To get extended error information, call GetLastError.

Remarks

It is recommended you compile the application using the Unicode character set, particularly if it is possible that mailbox names will contain Unicode characters or symbols. This will ensure that mailbox names are automatically converted from modified UTF-7 to UTF-16 Unicode. If Unicode is not used and a mailbox name contains non-ASCII characters, the name will be returned using a modified UTF-7 encoding format as defined by the IMAP4 standard. The mailbox name will not be returned as UTF-8 Unicode or as ANSI text converted to the current locale.

Requirements

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

See Also