Re: Setting IMAP a/c as the default store
- From: "Dmitry Streblechenko" <dmitry@xxxxxxxxxxx>
- Date: Tue, 5 Aug 2008 21:24:39 -0700
Is it even available in service table? Can you see it in OutlookSpy (click
Misc | IProfAdmin in OutlookSpy)?
--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
"exchange nerd" <rkukkadapu@xxxxxxxxxxx> wrote in message
news:140dc85ff5e24a03b9a5480051244699@xxxxxxxxxxxxx
I need to set my IMAP4 account as the default store. Can anyone4 help me in
this regard?
Here is my code -
HRESULT hRes = S_OK;
IMsgServiceAdmin* pMsgAdmin = NULL;
IMAPITable* lppTable = NULL;
LPMAPIERROR* lppError = NULL;
try
{
if (FAILED(hRes = m_lpMAPISession->AdminServices(0,&pMsgAdmin)) )
{
Log(true,L"Error getting Admin service Table.");
return hRes;
}
if (FAILED(hRes = pMsgAdmin->GetMsgServiceTable(0, // Flags.
&lppTable))) // Pointer to table.
{
Log(true,L"Error getting Message Service Table.");
return hRes;
}
enum {iEntID,iSvcName, iSvcUID, cptaSvc};
SRestriction sres; // Restriction structure.
SPropValue SvcProps; // Property structure for restriction.
LPSRowSet lpSvcRows = NULL; // Rowset to hold results of table
query.
//SizedSPropTagArray(cptaSvc,sptCols) = { cptaSvc, PR_ENTRYID,
PR_SERVICE_NAME, PR_SERVICE_UID,PR_DISPLAY_NAME_W};
SizedSPropTagArray(cptaSvc,sptCols) = { cptaSvc, PR_ENTRYID,
PR_SERVICE_NAME, PR_SERVICE_UID };
sres.rt = RES_CONTENT;
sres.res.resContent.ulFuzzyLevel = FL_SUBSTRING;
sres.res.resContent.ulPropTag = PR_SERVICE_NAME;
sres.res.resContent.lpProp = &SvcProps;
SvcProps.ulPropTag = PR_SERVICE_NAME;
SvcProps.Value.lpszW = L"INTERSTOR";
//lppTable->FindRow()
if (FAILED(hRes = HrQueryAllRows(lppTable,
(LPSPropTagArray)&sptCols,
&sres,
NULL,
0,
&lpSvcRows)))
{
Log(true,L"Error querying table for new message Service ");
return hRes;
}
//LPMAPIUID lpMyServiceUID = (LPMAPIUID)
lpSvcRows->aRow->lpProps[iSvcUID].Value.bin.lpb;
LPENTRYID lpEntryID = (LPENTRYID)lpSvcRows->aRow->lpProps[iEntID].
Value.bin.lpb;
if (FAILED (hRes =
m_lpMAPISession->SetDefaultStore(MAPI_DEFAULT_STORE ,16,lpEntryID)) )
{
Log(true,L"Failed to SetDefaultStore %08x",hRes);
return hRes;
}
THe LPENTRYID seems to be invalid.
What am i missing??
url:http://www.ureader.com/gp/1475-1.aspx
.
- Follow-Ups:
- Re: Setting IMAP a/c as the default store
- From: Dmitry Streblechenko
- Re: Setting IMAP a/c as the default store
- References:
- Setting IMAP a/c as the default store
- From: exchange nerd
- Setting IMAP a/c as the default store
- Prev by Date: Setting IMAP a/c as the default store
- Next by Date: Re: Setting IMAP a/c as the default store
- Previous by thread: Setting IMAP a/c as the default store
- Next by thread: Re: Setting IMAP a/c as the default store
- Index(es):
Relevant Pages
|