Advertisement
Advertisement
| 07.24.2008 at 01:00PM PDT, ID: 23593581 |
|
[x]
Attachment Details
|
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: |
HRESULT hRes = S_OK;
_NameSpacePtr spSession = NULL;
m_spApp->GetNamespace(L"MAPI",&spSession);
IUnknown* lpMAPIObject = NULL;
LPMAPISESSION lpMAPISession = NULL;
hRes = spSession->get_MAPIOBJECT(&lpMAPIObject);
if (SUCCEEDED(hRes) && lpMAPIObject)
{
hRes = lpMAPIObject->QueryInterface(IID_IMAPISession,(LPVOID*)&lpMAPISession);
}
if (SUCCEEDED(hRes) && lpMAPISession)
{
LPPROFSECT lpPSGlobal = NULL;
//hRes = lpMAPISession->OpenProfileSection((LPMAPIUID)pbGlobalProfileSectionGuid, NULL, 0, &lpPSGlobal);
IMsgServiceAdmin* pMsgAdmin = NULL;
hRes = lpMAPISession->AdminServices(0,&pMsgAdmin);
IMAPITable* lppTable = NULL;
LPMAPIERROR* lppError = NULL;
if (hRes == S_OK)
{
//hRes = pMsgAdmin->GetMsgServiceTable(0,&lppTable);
//pMsgAdmin->GetLastError(hRes,MAPI_UNICODE,lppError);
//hRes = pMsgAdmin->GetProviderTable(0,&lppTable);
//pMsgAdmin->GetLastError(hRes,MAPI_UNICODE,lppError);
hRes = pMsgAdmin->CreateMsgService(TEXT("MSEMS"),NULL,0,MAPI_UNICODE);
if (hRes == MAPI_E_NOT_FOUND)
pMsgAdmin->GetLastError(hRes,MAPI_UNICODE,lppError);
}
|