Re: Setting IMAP a/c as the default store

Tech-Archive recommends: Fix windows errors by optimizing your registry



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


.



Relevant Pages

  • Re: reading loose .msg file and properties
    ... OutlookSpy - Outlook, CDO ... when tried using OpenIMsgOnIStg it gave hRes = -2147219963 ... To open an existing MSG file, ...
    (microsoft.public.win32.programmer.messaging)
  • Re: Setting IMAP a/c as the default store
    ... Do you get exactly the same entry id as displayed by MFCMAPI or OutlookSpy? ... LPMAPIERROR* lppError = NULL; ... return hRes; ... Log(true,L"Error querying table for new message Service ...
    (microsoft.public.win32.programmer.messaging)
  • Re: Search in GAL
    ... In hRes I get MAPI_E_TOO_COMPLEX value. ... Dmitry Streblechenko wrote: ... OutlookSpy - Outlook, CDO ... I wanted to search through GAL on Exchange but when I want to use property restriction in FindRow method it returns me MAPI_E_TOO_COMPLEX. ...
    (microsoft.public.win32.programmer.messaging)
  • Re: Setting IMAP a/c as the default store
    ... OutlookSpy - Outlook, CDO ... and MAPI Developer Tool ... HRESULT hRes = S_OK; ...
    (microsoft.public.win32.programmer.messaging)
  • Setting IMAP a/c as the default store
    ... HRESULT hRes = S_OK; ... SRestriction sres; // Restriction structure. ... Log(true,L"Error querying table for new message Service "); ...
    (microsoft.public.win32.programmer.messaging)