PRB: Error "800b0001" From HrMAPIOpenFolderEx()
ID: Q194435
|
The information in this article applies to:
-
Exchange Development Kit (EDK), versions 5.0, 5.5
-
Extended Messaging Application Programming Interface (MAPI), version 1.0
SYMPTOMS
When opening a folder with HrMAPIOpenFolderEx(), you may receive the
following error:
0x800b0001.
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 to 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 <edk.h>
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 :
Version : WINDOWS:1.0,5.0,5.5
Platform : WINDOWS
Issue type : kbprb