Microsoft KB Archive/194435

= Error "800B0001" from the HrMAPIOpenFolderEx function =

Article ID: 194435

Article Last Modified on 1/13/2006

-

APPLIES TO


 * Microsoft Exchange Development Kit 5.5
 * Microsoft Exchange Server 2003 Software Development Kit
 * Microsoft Messaging Application Programming Interface

-



This article was previously published under Q194435



SYMPTOMS
When you open a folder by using the HrMAPIOpenFolderEx function, you may receive the following error message:

800B0001- MAPI_E_PROVIDER_UNKNOWN



CAUSE
The cause of the error is an invalid folder path.



MORE INFORMATION
The following code demonstrates the problem. The first call to open a folder fails because the path of the folder is incorrect. The second call succeeds because the path has been corrected.

The following additional libraries are required to compile this code:
 * Msvcrt.lib
 * Edkguid.lib
 * Addrlkup.lib
 * Version.lib
 * Edkutils.lib
 * Edkdebug.lib
 * Edkmapi.lib
 * Mapi32.lib
 * Aclcls.lib

Sample code
#include 

LPMAPISESSION        lpMapiSession = NULL; LPMDB                lpPrivStore = NULL; LPMAPIFOLDER         lpFolder = NULL; LPMAPITABLE          lpContentTable = NULL; LPSRowSet            lpRows = NULL; ULONG                rCount = 0, i = 0; HRESULT              hr; MAPIINIT_0           MapiInit; char                 lngName[100];

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE, LPSTR pszCmd,                      int nCmdShow) {     MapiInit.ulVersion = 0; MapiInit.ulFlags = MAPI_NT_SERVICE;

hr = MAPIInitialize( &MapiInit); if (!HR_SUCCEEDED(hr)) {       MessageBox(0L,"MAPIInitialize error","Error",MB_OK); return -1; }

hr = MAPILogonEx( 0, (LPTSTR)NULL, (LPTSTR)"",                       MAPI_NEW_SESSION | MAPI_EXTENDED | MAPI_LOGON_UI,                        &lpMapiSession); if (!HR_SUCCEEDED(hr)) {       MessageBox(0L,"MAPILogonEx error","Error",MB_OK); return -1; }

hr = HrOpenExchangePrivateStore( lpMapiSession, &lpPrivStore); if (!HR_SUCCEEDED(hr)) {       MessageBox(0L,"HrOpenExchangePrivateStore error","Error",MB_OK); return -1; }

hr = HrMAPIOpenFolderEx(lpPrivStore,'\\',"\\Inbox",&lpFolder); if (!HR_SUCCEEDED(hr)) {       char szError[50]; sprintf(szError, "HrMAPIOpenFolderEx error %x",hr); MessageBox(0L,szError,"Error",MB_OK); }

hr = HrMAPIOpenFolderEx(lpPrivStore,'\\',                       "Top of Information Store\\Inbox",&lpFolder); if (!HR_SUCCEEDED(hr)) {       MessageBox(0L,"HrMAPIOpenFolderEx error","Error",MB_OK); return -1; }     else MessageBox(0L,"HrMAPIOpenFolderEx Successful","Error",MB_OK);

if (lpMapiSession) {       lpMapiSession->Logoff(0, 0, 0); ULRELEASE(lpMapiSession); }     MAPIUninitialize;

return 0 ; }

Additional query words: kbEDK kbEDK500 kbEDK550 kbMsg kbMAPI kbMAPI100

Keywords: kbprb KB194435

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.