Re: Using custom dialog template for Pagesetup dialog

"arasakumaran" <arasakumaran-/[email protected]>
Newsgroups gmane.comp.windows.wtl
Message-ID <[email protected]>
--- In [email protected], "domehead100" <domehead100@...> wrote:
>
> --- In [email protected], "arasakumaran" <arasakumaran@> wrote:
> >
> > Hi.
> > 
> > I need to customize the PageSetup dialog, extending the standard (Common) dialog with some additional control. I have a replacement dialog template that has the additonal controls and uses the standard control IDs for the ones that are part of the standard.
> > 
> > Actually, I am converting an MFC class to WTL and am stuck a bit. In MFC, the new class is derived from CPageSetupDialog and uses the enum IDD= IDD_CUSTOM_TEMPLATE. In fact, it is just like a regular dialog class. Everything works as expected.
> > 
> > However the WTL class for the Coomon Dialog PageSetup is not based on CDialogImpl, but CWindowImpl. Hence my difficulty - I don't know how to get the class to use my template, not the standard template. I also don't know how to set it up so that I use the HookProc.
> > 
> > Is there an example that I can look at?  Thanks.
> >
> 
> I've never used CPageSetupDialog, but looking at the source in atldlgs.h shows:
> 
> ///////////////////////////////////////////////////////////////////////////////
> // CPageSetupDialogImpl - Page Setup dialog
> 
> #ifndef _WIN32_WCE
> 
> template <class T>
> class ATL_NO_VTABLE CPageSetupDialogImpl : public CCommonDialogImplBase
> {
> public:
> 	PAGESETUPDLG m_psd;
> 	ATL::CWndProcThunk m_thunkPaint;
> ...
> 
> Notice that the PAGESETUPDLG structure is a public member.  So can't you just set the m_psd.lpSetupTemplateName or m_psd.hPageSetupTemplate member (depending on how you are doing it) to your custom template before calling DoModal()?
> 
> ~Mike
>

Thanks Mike.  I had seen that about the same time.  I now can get my dialog. But have not yet figured out how to use the HookProc, or even if I need to do it. May be I just place a message map and see if the messages get routed to my class.




------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/wtl/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/wtl/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:[email protected] 
    mailto:[email protected]

<*> To unsubscribe from this group, send an email to:
    [email protected]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.