Error while creating a Message service to a new profile

D

Digambar Borse

Hello All,
I want to open PST file. I tried it by creating a new
profile then calling CreatMsgService for that profile, but its giving
error that Service not found with error MAPI_E_NOT_FOUND. I given the
service name as "MSPST MS",It is present in [Service] section of
MAPISVC.INF.
I'm useing the folowing code

IProfAdmin *pProfAdmin;
hr = MAPIAdminProfiles(0,&pProfAdmin);
hr = pProfAdmin->CreateProfile(L"MyProf",L"abcd",NULL,0);
IMsgServiceAdmin *imsadmin;
hr = pProfAdmin->AdminServices(L"MyProf",L"abcd",NULL,0,&imsadmin);

if (hr!=S_OK)
{
pProfAdmin->Release();
return -1;
}
// Now we create the message-store-service. Read <mspst.h> for
more details.
hr = imsadmin->CreateMsgService(L"MSPST MS",L"My Message Store",
NULL, SERVICE_UI_ALLOWED);
if( hr == MAPI_E_NOT_FOUND)
{
AfxMessageBox(L"MAPI not found ");
}


Any Idea why its giving error for creating error?
Thanking You,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top