shuqin he
unread,Sep 2, 2009, 10:44:54 PM9/2/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Nektra-NKTWAB
Hi, i am developing my application using C++ with the help of NKT
WAB .And i've downloaded the NKT WAB V2.1.0 Source Code.
The problem is that i don't know how to add contacts into my OE group
in my application, although i see in the source code that it is
appending the EntryId of the existing contact to the DistList.
Now i can get the DistributionListArray by the property of
PR_DISTLIST_ENTYRIDS and then create the new "lpProp" of LPSPropValue
type.
So how can i set the new "lpProp" as the value of the tag
"PR_DISTLIST_ENTRYIDS" of my OE group? In the source code, it is done
by "SetField(lpProp)" and i am puzzled by the global varialbe
"_changeProps" of "PropMap" type in the function of SetField();
because i can't find any initalization of the varialbe "_changeProps"
in the context. Is it releate to COM? but i know little about it....
So the key is that how can i retrieve "_changeProps" ? if i get it,
maybe i can i set the new "lpProp" as the value of the tag
"PR_DISTLIST_ENTRYIDS" of my OE group. Addtional, it failed when i use
"lpDistList->SetProps(1, lpProp, NULL)" ;
So Could you please give me some tips about that? Thanks a lot~~
The below is my C++ source code of this part:
if(lpContactEntryID)
{
HRESULT hr = E_FAIL;
LPSPropValue lpOldProp;
LPSPropValue lpProp;
SBinary *lpBin, *lpOldBin;
SBinaryArray *lpOldValue;
int cValues = 1;
ULONG arraySize = 0;
lpOldProp = GetDistributionListArray(lpDistList);
lpOldValue = &lpOldProp->Value.MVbin;
if(lpOldValue)
{
cValues = lpOldValue->cValues + 1;
lpOldBin = lpOldValue->lpbin;
}
hr = m_lpWABObject->AllocateBuffer(sizeof(SPropValue), (LPVOID *)
&lpProp);
hr = m_lpWABObject->AllocateMore(sizeof(SBinary)*cValues, lpProp,
(LPVOID *) &lpBin);
lpProp->dwAlignPad = 0;
lpProp->ulPropTag = PR_DISTLIST_ENTRYIDS;
lpProp->Value.MVbin.cValues = cValues;
lpProp->Value.MVbin.lpbin = lpBin;
for(int i=0; i<(int)cValues; i++)
{
if(lpOldValue && i < (int)lpOldValue->cValues)
{
m_lpWABObject->AllocateMore(lpOldValue->lpbin[i].cb, lpProp,
(LPVOID *) &lpBin[i].lpb);
lpBin[i].cb = lpOldValue->lpbin[i].cb;
memcpy(lpBin[i].lpb, lpOldValue->lpbin[i].lpb, lpOldValue->lpbin
[i].cb);
}
else
{
m_lpWABObject->AllocateMore(cbContactEntryID, lpProp, (LPVOID *)
&lpBin[i].lpb);
lpBin[i].cb = cbContactEntryID;
memcpy(lpBin[i].lpb, lpContactEntryID, cbContactEntryID);
}
}
if(lpOldProp)
{
m_lpWABObject->FreeBuffer(lpOldProp);
}
hr = lpDistList->SetProps(1, lpProp, NULL);