A store provider can send as part of a MAPI Uniform Resource Locator (URL) an entry ID and an attachment ID to the MAPI Protocol Handler to identify an object that is ready for indexing. The store provider encodes the entry ID and attachment ID as Unicode strings. This topic shows an algorithm that generates a compact representation of the entry ID or attachment ID.
// rgbID is the item Entry ID or the attachment ID
// cbID is the size in bytes of rgbID
// Allocate memory for pwzIDEncoded
pwzIDEncoded = new WCHAR[cbEID];
if (!pwzIDEncoded) return NULL;
for (i = 0, pbSrc = (LPBYTE)rgbID, pwzDst = pwzIDEncoded;
i < cbEID;
i++, pbSrc++, pwzDst++)
*pwzDst = (WCHAR) (*pbSrc + kwBaseOffset);
// Ensure NULL terminated
*pwzDst = L'\0';
// pwzIDEncoded now contains the entry ID encoded.