Click here to Skip to main content
14,980,146 members
Home / Discussions / C / C++ / MFC

C / C++ / MFC

GeneralRe: hi all Pin
ashish dogra28-Jun-06 20:45
Memberashish dogra28-Jun-06 20:45 
GeneralRe: hi all Pin
Hamid_RT28-Jun-06 20:46
MemberHamid_RT28-Jun-06 20:46 
GeneralRe: hi all Pin
ashish dogra28-Jun-06 21:05
Memberashish dogra28-Jun-06 21:05 
GeneralRe: hi all Pin
Hamid_RT28-Jun-06 21:32
MemberHamid_RT28-Jun-06 21:32 
GeneralRe: hi all Pin
ashish dogra28-Jun-06 21:45
Memberashish dogra28-Jun-06 21:45 
AnswerRe: hi all [modified] Pin
ovidiucucu28-Jun-06 20:31
Memberovidiucucu28-Jun-06 20:31 
GeneralRe: hi all Pin
Nawal K Gupta28-Jun-06 21:03
MemberNawal K Gupta28-Jun-06 21:03 
GeneralRe: hi all Pin
ovidiucucu28-Jun-06 22:21
Memberovidiucucu28-Jun-06 22:21 
Questionregarding CFile Pin
happy_ram28-Jun-06 19:29
Memberhappy_ram28-Jun-06 19:29 
AnswerRe: regarding CFile Pin
Naveen28-Jun-06 19:33
MemberNaveen28-Jun-06 19:33 
AnswerRe: regarding CFile Pin
David Crow29-Jun-06 3:19
MemberDavid Crow29-Jun-06 3:19 
QuestionProblem with wizard type application Pin
rajeevktripathi28-Jun-06 19:10
Memberrajeevktripathi28-Jun-06 19:10 
AnswerRe: Problem with wizard type application Pin
Blake Miller29-Jun-06 4:56
MemberBlake Miller29-Jun-06 4:56 
QuestionPrinting [modified] Pin
RockyJames28-Jun-06 18:38
MemberRockyJames28-Jun-06 18:38 
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 

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:

//in VC6, winxp2, outlook2003
class mymail : public IExchExt, public IExchExtMessageEvents

STDMETHODIMP mymail::OnCheckNames(IExchExtCallback *lpExchangeCallback)
LPADRLIST pRecipentRows = NULL;
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 ""
LPSTR pNow = pRecipentRows->aEntries[n].rgPropVals[i].Value.lpszA;

// i want to change email address to ""
char* p = "";
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 

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.