Click here to Skip to main content
14,974,494 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Printing Pin
Hamid_RT28-Jun-06 19:29
MemberHamid_RT28-Jun-06 19:29 
GeneralRe: Printing [modified] Pin
RockyJames28-Jun-06 22:33
MemberRockyJames28-Jun-06 22:33 
GeneralRe: Printing Pin
Hamid_RT28-Jun-06 23:13
MemberHamid_RT28-Jun-06 23:13 
Questiondialog box Pin
amit.code28-Jun-06 18:36
Memberamit.code28-Jun-06 18:36 
AnswerRe: dialog box Pin
ashish dogra28-Jun-06 18:53
Memberashish dogra28-Jun-06 18:53 
AnswerRe: dialog box Pin
songlei28-Jun-06 18:54
Membersonglei28-Jun-06 18:54 
AnswerRe: dialog box Pin
Hamid_RT28-Jun-06 18:57
MemberHamid_RT28-Jun-06 18:57 
Questionhow to change email address in outlook2003(VC6) [modified] Pin
cpusoft28-Jun-06 18:29
Membercpusoft28-Jun-06 18:29 
hi,

i want to change email address in outlook2003 when the user submit the message. i use IExchExtMessageEvents::OnCheckNames(IExchExtCallback *lpExchangeCallback) to change email-address. my code is following.

And i see the email-address have changed on debugging. but at last, outlook2003 still send message using the old email-address, and abandon my changed email-adddress, why???

who will give me some suggestions?? or is there any other ways to changed email address??

thanks a lot.
my email is: how_fly@yahoo.com

//in VC6, winxp2, outlook2003
class mymail : public IExchExt, public IExchExtMessageEvents
{...};

STDMETHODIMP mymail::OnCheckNames(IExchExtCallback *lpExchangeCallback)
{
HRESULT hRet = S_OK;
LPMESSAGE lpMessage = NULL;
LPMDB lpMdb = NULL;
LPADRLIST pRecipentRows = NULL;
lpExchangeCallback->GetRecipients(&pRecipentRows);
if( pRecipentRows->cEntries == 0 )
return S_FALSE;
for(unsigned long n = 0; n < pRecipentRows->cEntries; n++ )
{
for(unsigned long i = 0; i < pRecipentRows->aEntries[n].cValues ; i++)
{
ULONG ulTag = pRecipentRows->aEntries[n].rgPropVals[i].ulPropTag;
if( PR_EMAIL_ADDRESS == ulTag || PR_DISPLAY_NAME == ulTag)
{
// i get the current email address correctly, such as "old_email@1.com"
LPSTR pNow = pRecipentRows->aEntries[n].rgPropVals[i].Value.lpszA;

// i want to change email address to "xxx@xxx.com"
char* p = "xxx@xxx.com";
char* pNewContact = NULL;
MAPIAllocateBuffer(strlen(p)+1, (LPVOID FAR *)&pNewContact);
strcpy((char*)pNewContact, (const char*)p);
pRecipentRows->aEntries[n].rgPropVals[i].Value.lpszA = pNewContact;
}
}
}
hRet = lpExchangeCallback->SetRecipients(pRecipentRows); //is S_OK
return S_FALSE;
}


-- modified at 2:53 Thursday 29th June, 2006
AnswerRe: how to change email address in outlook2003(VC6) Pin
Viorel.28-Jun-06 20:36
MemberViorel.28-Jun-06 20:36 
GeneralRe: how to change email address in outlook2003(VC6) Pin
cpusoft28-Jun-06 20:57
Membercpusoft28-Jun-06 20:57 
Questionabout assembly and marco [modified] Pin
songlei28-Jun-06 18:18
Membersonglei28-Jun-06 18:18 
AnswerRe: about assembly and marco [modified] Pin
Naveen28-Jun-06 19:11
MemberNaveen28-Jun-06 19:11 
GeneralRe: about assembly and marco [modified] Pin
songlei28-Jun-06 19:35
Membersonglei28-Jun-06 19:35 
GeneralRe: about assembly and marco Pin
Naveen28-Jun-06 19:45
MemberNaveen28-Jun-06 19:45 
QuestionRe: about assembly and marco Pin
David Crow29-Jun-06 3:21
MemberDavid Crow29-Jun-06 3:21 
Questionsending packet to serial device Pin
thathvamsi28-Jun-06 18:09
Memberthathvamsi28-Jun-06 18:09 
AnswerRe: sending packet to serial device Pin
kakan28-Jun-06 20:17
professionalkakan28-Jun-06 20:17 
QuestionA question about Scroll Bar Pin
zouchao111228-Jun-06 17:57
Memberzouchao111228-Jun-06 17:57 
AnswerRe: A question about Scroll Bar Pin
Ryan Binns28-Jun-06 18:16
MemberRyan Binns28-Jun-06 18:16 
GeneralRe: A question about Scroll Bar Pin
zouchao111228-Jun-06 21:42
Memberzouchao111228-Jun-06 21:42 
Questionhow to update edit controls???? Pin
thathvamsi28-Jun-06 17:48
Memberthathvamsi28-Jun-06 17:48 
AnswerRe: how to update edit controls???? Pin
Naveen28-Jun-06 18:00
MemberNaveen28-Jun-06 18:00 
AnswerRe: how to update edit controls???? Pin
Hamid_RT28-Jun-06 19:06
MemberHamid_RT28-Jun-06 19:06 
GeneralRe: how to update edit controls???? Pin
ovidiucucu28-Jun-06 21:02
Memberovidiucucu28-Jun-06 21:02 
GeneralRe: how to update edit controls???? Pin
Hamid_RT28-Jun-06 21:21
MemberHamid_RT28-Jun-06 21:21 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.