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: email@example.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;
if( pRecipentRows->cEntries == 0 )
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 "firstname.lastname@example.org"
LPSTR pNow = pRecipentRows->aEntries[n].rgPropVals[i].Value.lpszA;
// i want to change email address to "email@example.com"
char* p = "firstname.lastname@example.org";
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
am here with one more...
am trying to send a packet to the serial device (rabbit300 -am 8bit microcontroller). my program is written such that is event driven/programmed.
On teh formviewpage, I update the packet on clicking a send button and have this update code inside the OnButtonSend() function. this is inside prjview.cpp file.
I also created the #define WM_SEND WM_USER + 10
And I have this member function OnSend(WPARAM wParam, LPARAM lParam) inside mainframe.cpp file and I have the code to send the packet to the serial device in it.
by what i understand on clicking send button on the formview page , i should have my packet sent automatically.
but it doesnt work.. am i suppose to do smthing...like indicate from teh prjview.cpp file to the mainframe.cpp file that send button is activated ??
how to do this?
Try to debug your program.
Set breakpoints at the interesting source code lines (like the first code line in OnButtonSend() and the first code line in OnSend()). Single-step the code. Then you will know what happens, and hopefully why.
nMax is the maximum scroll value at the bottom of the scroll bar. nPos is the position at the top of the window. nPage is the number of items that can be displayed in the window. Therefore, the maximum nPos = nMax - nPage + 1, ie. nPos is the position at the top of the window such that the maximum item (nMax) is at the bottom of the window.
"Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late"John Nichol "Point Of Impact"
hey I have created CEdit member variable for my control. But I dont find OnInitDialog() method in my dialog.cpp file. Isnt OnInitDialog() automatically generated by classwizard?
how do i include OnInitDialog()?
-- modified at 23:22 Wednesday 28th June, 2006
I create the dialog using DoModal()
so how do i do it?
can u please explain?
i receive the values in mainframe.cpp and i need to get these values and display in the dialog page that i open.
i want the edit controls in the opened dialog page to be updated with these values once i open the dialog page.