IMAPITable->Restrict() always returns E_INVALIDARG
- From: "Eric Jacob" <jacoberic23@xxxxxxxxx>
- Date: Tue, 30 Oct 2007 19:31:27 -0400
I've seen this same questions asked many different places on the web but I've never seen a response.
The following question was originally asked by "vjsharm":
i am trying to filter messages using IMAPITABLES's Restrict function.
but on its usage it returns E_INVALIDARGS as result.
here's code for ur reference.
HRESULT FilterMessagesExt()
{
HRESULT hRes;
LPSRowSet pRows = NULL;
SRestriction sres;
SPropValue spv;
LPMAPIFOLDER pFldr;
LPMAPITABLE pCTbl;
ULONG lCount ;
SRowSet *prowset = NULL;
HRESULT hr = S_OK;
SizedSPropTagArray(1,spt) = {1,PR_SENDER_NAME };
//this is my utility function to return the folder
pFldr=OpenFolder(Inboxfolder);
hRes = pFldr->GetContentsTable(0,&pCTbl);
// select columns first
hRes = pCTbl->SetColumns((LPSPropTagArray)&spt,0);
// sort depends on result of Restrict, do first
sres.rt = RES_PROPERTY;
spv.ulPropTag =PR_SENDER_NAME ;
spv.Value.lpszW = (LPWSTR)("Sharma, Kapil");
sres.res.resProperty.relop = RELOP_NE;
sres.res.resProperty.ulPropTag =PR_SENDER_NAME;
sres.res.resProperty.lpProp = &spv;
//here hRes gets E_INVALIDARGS as result
hRes = pCTbl->Restrict(&sres,TBL_BATCH);
pCTbl->GetRowCount(0,&lCount);
return hRes;
}
--------------------------
I've tried using various types of properties such as PR_MESSAGE_DELIVERY_TIME and PR_LAST_MODIFICATION_TIME but it always returns E_INVALID_ARG. The MSDN documentation says IMAPITable->Restrict is supported on Pocket PC 2002 or later as long as "rt" equals RES_PROPERTY.
Any ideas?
.
- Prev by Date: Issues in deploying solution (Windows Mobile 5.0 for Pocket PC)
- Next by Date: WM5 to WM6 GPSID Problem on HTC P3300
- Previous by thread: Issues in deploying solution (Windows Mobile 5.0 for Pocket PC)
- Next by thread: WM5 to WM6 GPSID Problem on HTC P3300
- Index(es):
Relevant Pages
|