Post by Dave Goldman [MSFT]Don't pass MAPI_UNICODE as this will cause it to fail. You can pass NULL. Here is a small example for you and you can fix the rest of it but you get the idea.
if (SUCCEEDED(hr = pSession->GetMsgStoresTable(0, &pTable)))
{
if (SUCCEEDED(hr = pTable->QueryRows(1, 0, &pSRowSet)))
{
if(FAILED(hr = pSession->OpenMsgStore(0, pSRowSet->aRow[0].lpProps[0].Value.bin.cb,
(ENTRYID *)pSRowSet->aRow[0].lpProps[0].Value.bin.lpb, NULL, 0, &pStore)))
{
print("OpenMsgStore");
return hr;
{
}
else
{
print("QueryRowserror");
return hr;
}
}
else
{
print("GetMsgStoresTable error");
return hr;
}
pTable->Release();
FreeProws(pSRowSet);
--
This posting is provided "AS IS" with no warranties, and confers no rights.
Dgoldmanhttp://blogs.msdn.com/dgoldman
Download OABInteg (http://gotdotnet.com/Community/UserSamples/Download.aspx?SampleGuid=A...)
Hi,
I was trying to get mailbox store information using
"GetMsgStoresTable" MAPI call.
hr = pSession->GetMsgStoresTable(MAPI_UNICODE, &pTable);
But its failing as MAPI_E_BAD_CHARWIDTH. In net I found that this is
something to do with UNICODE ( The MAPI_UNICODE flag was set and MAPI
does not support Unicode at present.) but not getting how to fix this
so that I can get these store information. If any one is having sample
code or hint on proceeding further on this please let me know.
Regards,
Shivaraj
Hi Dave,
Thanks a lot for your information and sample code. I was able to
resolve it using above said approach.
Now eventhough my code is workign fine, still i have got some more
doubts with respect to store in MAPI.
1. If I see system manager there is a clean hirarchy of organization -
Post by Dave Goldman [MSFT]Administrative group -> Servers -> Storage Group -> Mailbox Store ->
MailBoxes. Through MAPI using "HrOpenExchangePrivateStore" I was able
to retrieve all mailbox information within a server (from all mailbox
stores). But my understanding was, using "GetMsgStoresTable" and
"OpenMsgStore" we should be able to get Mailbox store names. ( to get
clean mapping of StorageGroup -> MailboxStore -> MailBox mapping ).
But if i get PR_DISPLAY_NAME of each row in "GetMsgStoresTable", its
is returning something like "Mailbox - Administrator" and "Public
Folders". Any idea/views/suggestions will be appriciated as I am not
clear about MAPI MailboxStore concept.
2. I have a parent and child domain setup. My exchange server resides
in child domain. If I run my code ( C++ code to get mailbox
information ) with Administrative privilages of child domain, i am
able to retrieve all info. But if i create a user and make it as
domain admin and try to run my code, its failing during
"HrOpenExchangePrivateStore" call. Any extra permissions are required
for this?
Please let me know your views.
Regards,
Shivaraj