Re: OnApply processing in CPropertySheetImpl

Anthony Williams <anthony_w.geo-/[email protected]>
Newsgroups gmane.comp.windows.wtl
Message-ID <[email protected]>
Rob Marsden <rob-uNoPq/[email protected]> writes:

> It seems that only one OnApply() is being called no matter what the 
> 'dirty' state is for each page. When I click the Apply button, a 
> PSN_KILLACTIVE message is sent to the currently open page, but the 
> following PSN_APPLY goes to the lowest numbered page that has been 
> created (pages only seem to be created when first displayed). Assuming 
> the second page is displayed, the first page has never been displayed, 
> and page two is dirty, then I click Apply, then all works as expected 
> and page two OnApply is called. In exactly the same circumstances, 
> except that page one has previously been viewed, and hence created, then 
> the PSN_APPLY goes to page one, even though I was looking at a 'dirty' 
> page two.
>
> All a bit complicated to explain, but is this expected behaviour? I was 
> expecting OnApply to be called either, for all pages, or all pages that 
> had recorded themselves as 'dirty' with 'SetModified(m_bDirty)'.

PSN_APPLY is sent to each page in turn until a page returns an error
code. If a page returns "no error" then the notification is sent to the
next page until all pages have been notified. If a page returns
"invalid" then the notifications are stopped.

http://msdn.microsoft.com/en-us/library/bb774552.aspx

I've never had a problem with property sheets. Are you setting the
return code correctly? In particular, are you defining
_WTL_NEW_PAGE_NOTIFY_HANDLERS? If so, then you need to be returning
PSNRET_NOERROR from your OnApply function; if are are not defining that
macro then you need to return true from your OnApply function.

Anthony
-- 
Author of C++ Concurrency in Action     http://www.stdthread.co.uk/book/
just::thread C++0x thread library             http://www.stdthread.co.uk
Just Software Solutions Ltd       http://www.justsoftwaresolutions.co.uk
15 Carrallack Mews, St Just, Cornwall, TR19 7UL, UK. Company No. 5478976



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

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:
    [email protected] 
    [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.