|
You get exception because dialog for the 'next' page has not been created yet.
I usually send a 'faked' next button press to the parent of wizard pages and it 'thinks' the user has pressed next button. That seems to always work out well.
I've seen better runs in my shorts! - Patches O'Houlihan
|
|
|
|
|
Hi,I have taken FormView,in which i have created ListControl,The client area, "rect" of the FormView is taken is taken as i/p for ListControl Creation.I have handled WM_CONTEXTMENU in the formview,in the ContextMenu,there are two items one is "Print" another is "PntView"..ON_COMMAND of both ID_PRINT and ID_PRIVIEW i have handled in formview.in the respective functions i have called CFormView::OnFilePrint,CFormView::OnFilePrintPriview,i have overriden "Onprepareprinting" and "OnPrint".When i click print in the context menu , it is printing,when i click priview in the context preview is coming,but in the preview when i print button,it is not printing , what could be the reason...
Thanks in before
James
-- modified at 0:40 Thursday 29th June, 2006
|
|
|
|
|
When you click in this button your code is running or no
whitesky
|
|
|
|
|
No it is not called.it is called when i click print and printpreview in context menu....
-- modified at 4:35 Thursday 29th June, 2006
|
|
|
|
|
well i guess your problem is event button do you check event for your button
whitesky
|
|
|
|
|
i am on mfc dialog based. how to open a new dialog box on clicking the button .
prashant jain
|
|
|
|
|
CClassname dlg;
dlg.DoModa();
Ashish Dogra
MCA
Noida
|
|
|
|
|
//the CNewDlg is new dialog box class
//add these code to button proc
//(my english is very poor)
//ex:
<br />
void COldDlg::OnButton1()<br />
{<br />
CNewDlg dlg;<br />
dlg.DoModal();<br />
}<br />
|
|
|
|
|
m_Dialog.DoModal();
or
<br />
m_Dialog.Create(IDD_YOURDIALOG);<br />
m_Dialog.ShowWindow(1);<br />
whitesky
|
|
|
|
|
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
|
|
|
|
|
Maybe instead of
strcpy((char*)p, (const char*)pNewContact);
you should have
strcpy(pNewContact, p);
Hope it helps.
|
|
|
|
|
oh, sorry,i type the code wrong. i have corrected it.
but it is still not work well.
thanks any way.
|
|
|
|
|
/*
complier: vc6 sp6
*/
<br />
#include<stdio.h><br />
<br />
#define x_x(n) \<br />
__asm mov eax, $ \<br />
__asm mov n, eax <br />
<br />
int main()<br />
{<br />
int n;<br />
x_x(n);<br />
printf("%d\n", n);<br />
}<br />
///////////
why output is 0?
help me...
-- modified at 0:20 Thursday 29th June, 2006
|
|
|
|
|
songlei wrote: why output is 0?
the effective assembley lanuage for this will be as shown below
004010F8 mov eax,0<br />
004010FD mov dword ptr [ebp-4],eax
the $ is replace with 0.
why u use $ there?
nave
|
|
|
|
|
the value of $ is 0 when uses marco.
if direct use,
ex:
<br />
int main()<br />
{<br />
int n<br />
_x:<br />
__asm mov [n], $<br />
printf("%d", n);<br />
}<br />
_x == n is true!!
(sorry, my engish is poor, maybe...)
-- modified at 1:36 Thursday 29th June, 2006
|
|
|
|
|
songlei wrote: _x == n is true!!
sorry i didn't understand..Can u plz explain more
nave
|
|
|
|
|
songlei wrote: why output is 0?
What should it be?
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
hey guys.......
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.
|
|
|
|
|
Firstly, I set the scroll bar info:
info.nMin = 0;
info.nMax = 41;
info.nPage = 10;
info.nPos = 0;
but when I scroll the bar, the scroll bar goes to end when info.nPos = 32, why is this?
|
|
|
|
|
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.
Ryan "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"
|
|
|
|
|
Thanks for your in time reply.....
|
|
|
|
|
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()
|
|
|
|
|
Add a message handler for WM_INITDIALOG message using class wizard. the u will get the OnInitDialog function.
nave
|
|
|
|
|
goto page property then click in overriders then click OnInitDialog
whitesky
|
|
|
|