www.pudn.com > MailCheck_src.zip > UTILS.CPP
/***************************************************************************
* utils.cpp : Contains simple utility functions
* Copyright (c) 1996, Microsoft Corporation
*
* Sample extended MAPI app with new mail notifications
*
* History:
* 1 Oct 1996 Vajira Weerasekera
\***************************************************************************/
#include "utils.h"
// Function nest throught the given row set using the lpFreeBuff function to
// free each item
//
void FreeRowSet(LPFREEBUFFER lpFreeBuff,LPSRowSet prs)
{
for (int i=0;i<(int) prs->cRows;i++)
lpFreeBuff(prs->aRow[i].lpProps);
lpFreeBuff(prs);
}
// Loop through all the proerties in the RowSet and return the
// property that matches the ulPropTag
//
LPSPropValue SRowFindProp (LPSRow lpRow, ULONG ulPropTag)
{
LPSPropValue lpProp = lpRow->lpProps;
ULONG cValues = lpRow->cValues;
while (cValues) {
if (lpProp->ulPropTag == ulPropTag)
return lpProp;
lpProp++;
cValues--;
}
return NULL;
}