RE: How to close a Property Sheet after deferred Save activity?

"Dick Dievendorff" <[email protected]>
Newsgroups gmane.comp.windows.wtl
Message-ID <001e01c9abbe$baf67620$30e36260$@net>
Thanks, Jim.    I do handle OnApply and respond appropriately to
OnQueryCancel when I'm in this state.  I still don't like it.  

 

Dick

 

 

From: [email protected] [mailto:[email protected]] On Behalf Of Jim
Barry
Sent: Monday, March 23, 2009 3:30 AM
To: [email protected]
Subject: Re: [wtl] How to close a Property Sheet after deferred Save
activity?

 

Dick Dievendorff wrote:
> I have a property sheet and a property page that has some number of
> edit controls. When the user presses OK or Apply I need to write the
> "dirty" control values to an external device (via a serial port) when
> the user clicks the "Apply" or "OK" buttons. My routines that send
> the values to the external device are asynchronous. I start a
> request and when the request is complete I receive an "event
> complete" sort of windows message. 
> 
> When I reach OnApply, I'm able to start the asynchronous "save"
> operation and respond with PSNRET_INVALID_NOCHANGEPAGE to keep the
> page from terminating immediately.

I think this approach is very problematic. For one thing, the user could
start messing around with the dialog and click the "Apply" or "Cancel"
button while you are doing your asynchronous transaction. Two possible
solutions: 

1) Make your transaction synchronous by moving it to a secondary thread,
which your OnApply handler waits for.

2) Perform the transaction outside of the property sheet, i.e. after it has
closed.

-- 
Jim Barry, Microsoft MVP





[Non-text portions of this message have been removed]



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

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.