PropertyPage problem

Hello,
I am working on wizard application using classes derived from
CPropertySheet and CPropertyPage.
Initially I will create a property sheet and add pages to that sheet.

(WizardSheet is derived from CPropertySheet)
   WizardSheet* ptrWizardSheet = NULL;
   ptrWizardSheet = new WizardSheet ();

(WizardPage is derived from CPropertyPage)
   WizardPage* page1 = new WizardPage();
   WizardPage* page2 = new WizardPage();
   ptrWizardSheet.AddPage(page1);
   ptrWizardSheet.AddPage(page2);

Using the above page's HWND, I want to add a different dialog with
it's own controls on it. I must be allowed to work on those controls
and when I click on Next / Finish button in wizard, I must validate
all the controls on the added dialog.

Please sugges a solution for this ASAP.

Jay.
0
1/9/2008 2:11:28 PM
vc.mfc 33608 articles. 0 followers. Follow

8 Replies
762 Views

Similar Articles

[PageSpeed] 34

Why do you want to use an HWND?  What's wrong with using the normal PropertyPage methods
to add new pages?  You say "the above page's HWND" yet I see TWO pages, and of course
there's no way to tell if you mean page1 or page2, and in any case, it doesn't make any
difference; you would not use the HWND at all, and certainly it is irrelevant to adding
another dialog "with its own controls".  If you want to manipulate the pages, you can have
yet a third wizard page, and based on values in page1, you might change the next page to
be that one, but none of these involve an HWND in any way, shape, or form. It would help a
lot if you explained your problem instead of asking for asking for some kind of weird
implementation of something we don't even understand, and would not even consider as a
specification.
						joe

On Wed, 9 Jan 2008 06:11:28 -0800 (PST), jai.reddylm@gmail.com wrote:

>Hello,
>I am working on wizard application using classes derived from
>CPropertySheet and CPropertyPage.
>Initially I will create a property sheet and add pages to that sheet.
>
>(WizardSheet is derived from CPropertySheet)
>   WizardSheet* ptrWizardSheet = NULL;
>   ptrWizardSheet = new WizardSheet ();
>
>(WizardPage is derived from CPropertyPage)
>   WizardPage* page1 = new WizardPage();
>   WizardPage* page2 = new WizardPage();
>   ptrWizardSheet.AddPage(page1);
>   ptrWizardSheet.AddPage(page2);
>
>Using the above page's HWND, I want to add a different dialog with
>it's own controls on it. I must be allowed to work on those controls
>and when I click on Next / Finish button in wizard, I must validate
>all the controls on the added dialog.
>
>Please sugges a solution for this ASAP.
>
>Jay.
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15973)
1/9/2008 5:55:39 PM
jai.reddylm@gmail.com wrote:
> Hello,
> I am working on wizard application using classes derived from
> CPropertySheet and CPropertyPage.
> Initially I will create a property sheet and add pages to that sheet.
> 
> (WizardSheet is derived from CPropertySheet)
>    WizardSheet* ptrWizardSheet = NULL;
>    ptrWizardSheet = new WizardSheet ();
> 
> (WizardPage is derived from CPropertyPage)
>    WizardPage* page1 = new WizardPage();
>    WizardPage* page2 = new WizardPage();
>    ptrWizardSheet.AddPage(page1);
>    ptrWizardSheet.AddPage(page2);
> 
> Using the above page's HWND, I want to add a different dialog with
> it's own controls on it. I must be allowed to work on those controls
> and when I click on Next / Finish button in wizard, I must validate
> all the controls on the added dialog.

Jay:

You need to describe what you want to do in more detail.

-- 
David Wilkinson
Visual C++ MVP
0
no-reply8010 (1791)
1/10/2008 11:19:36 AM
Hello,
Thank you for your reply.
My requirement is, I want to have a wizard kind of application where
in dialogs from different DLLs should be displayed one after the
other.
1. Create a container (for ex: like propertysheet) in Application1.
2. To this container add different dialogs (for ex: like property
pages) from different DLLs. (dlg1 from DLL1, dlg2 from DLL2 etc).
3. When the Application1 is initialized / started, it should display
the first dialog (i.e. dlg1 from DLL1).
4. When I click on NEXT button of Application1, it should display the
second dialog (i.e. dlg2 from DLL2).
5. When I click on BACK button of Application1, it should display the
previous dialog with any old values already entered.

Jay.
0
1/10/2008 1:17:36 PM
<jai.reddylm@gmail.com> wrote in message 
news:f6b8e4ac-109f-4f2b-91fa-9928ae17b615@u10g2000prn.googlegroups.com...
> Hello,
> Thank you for your reply.
> My requirement is, I want to have a wizard kind of application where
> in dialogs from different DLLs should be displayed one after the
> other.
> 1. Create a container (for ex: like propertysheet) in Application1.
> 2. To this container add different dialogs (for ex: like property
> pages) from different DLLs. (dlg1 from DLL1, dlg2 from DLL2 etc).
> 3. When the Application1 is initialized / started, it should display
> the first dialog (i.e. dlg1 from DLL1).
> 4. When I click on NEXT button of Application1, it should display the
> second dialog (i.e. dlg2 from DLL2).
> 5. When I click on BACK button of Application1, it should display the
> previous dialog with any old values already entered.
>
> Jay.

It is difficult to create property pages whose dialogs are in other DLL's. 
The resaon is the constructor to CPropertyPage() uses the instance handle 
gotten by AfxGetResourceHandle(), and this can only be set to one exe or 
dll.  Maybe you could derive a CMyPropertyPage class with a ctor that knows 
how to call AfxSetResourceHandle() with the right prior to constructing the 
dialog.  Or maybe it's not the ctor that needs to do this, but another mthod 
that actually does the creating of the window.

-- David


0
dc2983 (3206)
1/10/2008 3:10:35 PM
I see no problem here.  When you create the property sheet, you ask the DLL to give you a
CPropertyPage to put into it.  No different than if you create the property pages in your
main executable.

Nothing you've done thus far precludes having the DLLs provide the CPropertyPages.

Just have the DLLs create the property pages, and David already told you how to do that.
No HWNDs are involved.  Your error was trying to create the property pages first, and
somehow magically rebinding the control to some other HWND.  That makes it very difficult.
					joe

On Thu, 10 Jan 2008 05:17:36 -0800 (PST), jai.reddylm@gmail.com wrote:

>Hello,
>Thank you for your reply.
>My requirement is, I want to have a wizard kind of application where
>in dialogs from different DLLs should be displayed one after the
>other.
>1. Create a container (for ex: like propertysheet) in Application1.
>2. To this container add different dialogs (for ex: like property
>pages) from different DLLs. (dlg1 from DLL1, dlg2 from DLL2 etc).
>3. When the Application1 is initialized / started, it should display
>the first dialog (i.e. dlg1 from DLL1).
>4. When I click on NEXT button of Application1, it should display the
>second dialog (i.e. dlg2 from DLL2).
>5. When I click on BACK button of Application1, it should display the
>previous dialog with any old values already entered.
>
>Jay.
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15973)
1/10/2008 4:19:53 PM
"Joseph M. Newcomer" <newcomer@flounder.com> wrote in message 
news:g2hco3p1qgqgij5lr2q00e4neq6780o1dq@4ax.com...
>I see no problem here.  When you create the property sheet, you ask the DLL 
>to give you a
> CPropertyPage to put into it.  No different than if you create the 
> property pages in your
> main executable.
>

That would solve the problem about the resource instance handle very nicely.

-- David


0
dc2983 (3206)
1/10/2008 4:25:05 PM
Yes, I can ask the DLL to give a CPropertyPage to put into
CPropertySheet.
When we use CPropertySheet and CPropertyPage, for navigating between
pages (BACK and NEXT), we have to override "OnWizardBack" and
"OnWizardNext" methods in the class derived from CPropertyPage.
But I want the navigation between pages to be handled in Main
Application itself i.e. where the class derived from CPropertySheet
resides/available.
How can I achieve this ?
Jay.
0
1/11/2008 10:44:51 AM
<jai.reddylm@gmail.com> wrote in message 
news:d6f95452-2aa4-4fb7-953b-16647097d35b@y5g2000hsf.googlegroups.com...
> Yes, I can ask the DLL to give a CPropertyPage to put into
> CPropertySheet.
> When we use CPropertySheet and CPropertyPage, for navigating between
> pages (BACK and NEXT), we have to override "OnWizardBack" and
> "OnWizardNext" methods in the class derived from CPropertyPage.
> But I want the navigation between pages to be handled in Main
> Application itself i.e. where the class derived from CPropertySheet
> resides/available.
> How can I achieve this ?
> Jay.

You could derive your property pages from a class called e.g. 
CMyPropertyPage, and then create something like
   CMyPropertyPage::SetNextPage(UINT page) and
   CMyPropertyPage::SetPrevPage(UINT page)

And the OnWizardNext() and OnWizardBack() uses the page that is passed to 
these Set functions.

Then your main .exe could call the Set functions to alter the flow.

-- David 


0
dc2983 (3206)
1/11/2008 1:50:21 PM
Reply:

Similar Artilces:

Exchange 2000 Information Store initialization Problem
Hi everyone I just had a huge problem with my Exchange 2000 server. A liitle prelude, I cannot mount the information store for both the Public and mailboxes in the entrerprise. In services all the exchange services are up and running normaly, this morning looking at the server i saw that the virtual drive M was missing in my PC folder. When tried to mount the mailbox store through the managment console i get an error saying that the store could not be found. I called microsoft support and ran a /p rebuilt utility. The utility detected that the store was corrupt. Microsofts solution was &quo...

SP3 Install Problems
I have copied SP3 to a cd-r and then went to the pos computer running Store Ops (no online access) to install SP3. I got an error message Looking for another CD. Can SP3 be copied to a system from a cd. chucky8822, It might be looking for the original MRMS install disk. Try copying the Microsoft Retail Management System Store Operations.msi file to the disk if you only have Store Operations installed on this machine. If you have HQ, copy the 2 .msi files from the HQ disk too. -- * "chucky8822" <chucky8822@discussions.microsoft.com> wrote in message news:A577019E-BF7F-...

How to Change the Background Color of PropertyPage
Hi Friends, I am saravanan , new to this Article. I am developing a project using PropertySheets and PropertyPages. My problem is how to change the background color of the propertyPage. I tried to change the Background color of the PropertySheet, it affects only the Background color of the sheet and not in the pages. Mainly i want to change the Background color of the PropertyPage Caption area.(ie Tab area). Can any one help me to do that. Thanks in advance. Regards, Saravanan -- saravanan_article ------------------------------------------------------------------------ Posted via http:/...

Excel percentage problem
Hi! My problem is in finding a formula for percentages. I hope I mak this clear.. I need to create a graph showing the failure rate of 4 differen types of relays going back 8 years and projecting 5 years in th future. Instuctructins include equating the number of relays to the bas 10,000. The first set of relay failures have to be divided by 4,and next two sets are divided by 2. Using this information I need to sho the percentage of failures per relay/per year. Any help would be ggreatly appreciated, as I have yet to even com close to anything that resembles a correct formula or answer. Thank ...

Cannot save Passwords problem
Hello. Having problems with saved passwords. Outlook 2003 and IE8 wouldn't save passwords. I have tried the following without success: kb en us 290684 Reverting to IE7 I loaded Google Chrome and it wont save either. Any further ideas? Would creating a new user be an option? Thanks ...

problem erasing CD-RW disc
Hello, I need to erase a CD-RW I use the follwing code: http://social.msdn.microsoft.com/Forums/en-US/windowsopticalplatform/thread/709d5658-6581-4dbc-8357-778cf052afe9 But I get this error: 0xC0AA090B E_IMAPI_ERASE_CLIENT_NAME_IS_NOT_VALID This obviously means: "The client name is not valid" http://msdn.microsoft.com/en-us/library/cc835244(VS.85).aspx But what is "The client" ? And what may cause this error? How could I use VBS to erase a RW CD or DVD? I use XP SP2 Thank you ...

data field problems
hi to all, i need to create a mail to notify to a CRM user when a contract is near to expire. I have created e workflow rule using the wait for condition but i don't able to notify in this mail the account name related to the contract expired. If i use a template it's work but if I copy the code in the body of the mail CRM doesn't covert the data filed in the account. Example: {!Contact:full name;customer} thanks in advanced Data field is only working in the email-template. It won't work in the email body if that is what you try to do. -- This posting is provided &qu...

Outllok email problem
Hi, I'm not sure if i am in the right place, but i am looking for some help. I am using Office XP, Outlook 2002 with WinXP home edition. Until recently everything was fine but now when i try and click on the "send/recieve" tool bar button, to downlaod my IMAP email, i just get a message "The operation failed. An object could not be found". Any help or suggestions welcome. Thanks Yep, that happens when I change from Outlook Express to Outlook as my default client. Just delete the profile (not copy) and then recreate it, all will work fine after that... ...

Problems upgrading 02 -> 04
Thanks for the info. The file is owned by me and I am an administrator. Double clicking in explorer gives me the exact same message. I tried safe mode and there too I get te same error. David >-----Original Message----- >In microsoft.public.money, David Harrison-Rand wrote: > >>Hi, >> >>I am trying to upgrade to Money 2004 from Money 2002 >>Deluxe but I always get the error in this link: >>href= >http://moneycentral.msn.com/money/2004/ee.asp? ProdVer=12.00.10.0613&FileName=MnyOb99.dll&FileVer=12.00.0 613&EvtSrc=mnyob99&EvtId=5101...

PropertyPage Buttons
I have a 3-page PropertyPage using CPropertySheet & CPropertyPage (as usual). My buttons are not what I expected. The code below is what I have on page2 (which is derived form CPropertyPage). I have commented out code just for referenced. This gives me 4-buttons: Back, Next, Cancel, Help. From the code below, I should only get the Back & Next button. BOOL CPage2::OnSetActive() { CPropertySheet* parent = (CPropertySheet*)GetParent(); parent->SetWizardButtons(PSWIZB_BACK | PSWIZB_NEXT); /* A set of flags that customize the function and appearance of the wiza...

Mixed language interface problem?
My apologies if you think this is off topic. I am using Developer Studio Visual C++ v6.0 with Compaq Visual Fortran 6.1a I am working on (ie adding to existing) C++ mfc dialogs in a shared dll which is called from Fortran. (It's a legacy system) My problem is that when I return from the dll I get "Access Violation" errors when subsequently trying to use a local variable in the Fortran. Stepping through in Debug mode the variable address and value are ok before entering the dll, on return the "watch" tells me that the variable has an illegal address - so far (in my t...

Anyone else having problems with Budget?
What is going on with the budget in MS Money 2004. I uncheck the Autobudget boxes, but they always are rechecked. I have an amount set for one item and that same amount shows up in a new category I never entered. Basically, it is so flaky, I can't trust it. What's Up? Thanks, Clark The autobudget works differently to how you think it does. When you go to the autobudget, it analyzes the transactions and checks those which it thinks could be added to your budget. If you then choose to add these to your budget, then you can. Next time you go to autobudget, it runs the same piece ...

spreadsheet problem
66 years old. I have been asked to record daily my weight and blood-sugar count. I am using Excel 2003 on a Vista machine. I am trying to compare averages between doctor visits. I have both columns formatted as number (select column>format>cells>number, 2dp) yet when I try to sum or average the numbers, the formula only includes the last 3 cells. It also will not add the .00 to the rest of the numbers in the columns. I have selected the entire spreadsheet and made sure the protection "lock" is not selected. I hope I explain myself well enough for ...

Receiving mail problem with" Enter Network Password" problem.
I got one lonely little reply to my earlier post on this topic, offering a link to a Microsoft reference that was "not available." I can't receive mail in Outlook 2003 on XP due to refusal of my (correct) Password by my mail server - and a dialog box headed "Enter Network Password" keeps on appearing over and over again, as long as Outlook (or Outlook Express) remains open. The Network Password box that appears already has a correct User Name and Password filled in! I have closed and reopened my Outlook 2003 mail account, run Detect and Repair, uninstalled and r...

Exchange 5.5 problem with NDR
Hello, I've got a problem with my Exchange 5.5 Server. I've applied the hotfix n� 837794 with allow to control the generation of the NDR. http://support.microsoft.com/default.aspx?scid=kb;EN-US;837794 I put in the registry, the DWORD value SuppressNDROptions = 1. No more NDR !!! But it's not the behavior I've expected. In fact, all I wanted was to block and delete the messages in the sending queue with "<>" as originator and "host unreachable" status when trying to send notification... Any idea ? Thanks Franck. Filtering for Blank Senders i...

Beginners problem with namespace/schema?
Hi, I have used xsl to transform xml from sqlserver in and it works fine now i have a webservice that uses a dataset to get the data and return it as xml like the code below <WebMethod()> _ Public Function ReturnEarnedValues() As XmlDocument Dim MyStream As New IO.StringWriter Dim XD As New XmlDocument OleDbDataAdapter1.Fill(MyDataSet1) MyDataSet1.WriteXml(MyStream) XD.LoadXml(MyStream.ToString) Return XD End Function Now the problem, my XSL does not work anymore and i think it has to do with the xmlns tag and "mydataset" be...

One User Has Problems with Outlook 2002
I have one particularly touchy user who this morning started complaining that her Outlook is slow and that when she goes to send a message often she gets the message "The data in your envelope has been lost but your document is still available." She swears this not true and the data is not found anywhere including drafts. I've searched the Knowledgebase for this error and found nothing. Has anyone else encountered this? E. L. Wimett Patriots Point ...

outlook 2007 : receiving email problems (win xp pro)
Hi everyone, I am not savy with outlook and I have a client who is having some unusual problems. any suggestions or help would be greatly appreciated. Here is what they have: they have a domain where they have 4 email accounts through it (ex: johnsmith@domain.com) they have 4 workstations in the office each workstation can send email but all recieved email goes to only one workstation. my client wants the email to be set so that each workstation gets to receive their individual emails, but at the same time have all emails still go to the on...

Outlook Outbox Problem...
I have recently upgraded from Office 97 to Office 2003. When composing, forwarding and replying to emails they go to the Outbox as unsent (no italics). I have to reopen the mails and forward them to the original addressee to get them in the ready to send mode (italicized). Any ideas on how to correct this? Thanks in advance, JT John Taylor wrote: > I have recently upgraded from Office 97 to Office 2003. > When composing, forwarding and replying to emails they go > to the Outbox as unsent (no italics). I have to reopen > the mails and forward them to the original addressee...

Problems with Outlook hanging (possibly CRM1.2 problem)
Hi, Apologies for the cross posting, but I'm not sure which is th ebest newsgroup to help... I'm Running a server with SBS 2003 & exchange. Installed CRM1.2 (at the moment it's only on the server & I can access via the web). I've not yet installed the Outlook client on my laptop. The problem is that I've been experiencing major "hangup" problems when connecting my laptop to the server. Everything works fine until I open up Outlook, then, although I an "ping" the server I am unable to access it either from Outlook to synchronise emails, ...

calender problems
By mistake I imported(old Schedule plus import) another user's calender into my outlook (I meant to just look at his calender). Now, of course, "people" (I still have this in testing mode) so no big deal, yet) think they are looking at my calender instead of his. How can I fix this? Also, his admin assistant has to view his calender, however, she has to use another Exchange server and you can't use two Exchange servers. Since I screwed up the import, viewing her boss's calender(in OWA) is impossible. Please advise. "amyb" <amy@npsg.ncifcrf.gov> wr...

Pocket PC problems
Hi Everyone, Sorry about posting this here, but I am not getting much responses in the PocketPC group. I am creating a window that acts a keyboard (My program needs to be in landscape mode, but since PPC 2000, and 2002 don't support that I had to do it myself). Anyway, I have a window in which I draw a keyboard. In OnLButtonDown I call keybd_event to press the button, and in OnLButtonUp I call keybd_event(..,KEYEVENTF_UP,) to release the button. Then I notice that couldn't type fast on the keyboard, and I realized that event though I am not tapping in the same place twice I am ge...

Odd newsgroup problem
I have two news servers set up in WLM - msnews.microsoft.com and news.eternal-september.org. This morning suddenly, I can access MS news server but not the other. The error message is this: "Windows Live Mail cannot connect to the Internet, possibly because an antivirus or firewall program won't allow it. Make sure any antivirus or firewall programs on your computer allow Windows Live Mail (wlmail.exe) to access the Internet. Details: Configuration: Account: news.eternal-september.org Server: news.eternal-september.org User name: xxxxxxxxx Protocol: NNTP ...

Pinpad problems
I'm using RMS and I got a Verifone PINpad 1000se from my card processor, so it was encrypted by them. The transaction seems to work okay at first. It shows the amount on the screen. The user presses enter and is prompted to enter their PIN. After the PIN is entered, RMS acts like it is processing it, but then ends up with status - failed and approval code - 19: RE-ENTER. They thought that maybe the encryption was wrong so they sent me a new pad, but it does exactly the same thing. I'm using the 9-pin serial connector attached to a COM port. Is there something in the configuration I ...

OleDraw() problem
I am using OleDraw() to try to draw 2 MSCharts on the same page. Like following: OleDraw(pChart1->GetControlUnknown(),DVASPECT_CONTENT,pDC->m_hDC,&rcTopHalf) ; OleDraw(pChart2->GetControlUnknown(),DVASPECT_CONTENT,pDC->m_hDC,&rcBottomHa lf); where pChart1 and pChart2 point to CMSChart objects; and rcTopHalf and rcBottomHalf are CRect to half of print/preview DC. pDC is CDC*. If I use *pDC instead of pDC->m_hDC, the result is the same. The pChart1 draws correctly. The problem is the second chart always draws outside the specified CRect. If I use the same rcTopHalf for ...