Re: Who is responsible for refreshing the UI?
- From: "Alexander Nickolov" <agnickolov@xxxxxxxx>
- Date: Tue, 16 May 2006 09:48:33 -0700
If your code must be synchronous, you can insert a message
pump each time before you raise your status update event.
This is not a perfect solution of course... Also, beware reentrancy.
--
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD
email: agnickolov@xxxxxxxx
MVP VC FAQ: http://www.mvps.org/vcfaq
=====================================
"Bruce E. Stemplewski" <Bruce.Stemplewski@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote
in message news:kO8ag.810$nq5.524@xxxxxxxxxxx
My OCX has a method that has a lengthy method so I call a connection point
(event) to keep the calling application updated on the progress of the
method.
Now I am no VB programmer so I am not sure if I wrote my sample code
correctly but one thing I have noticed is that UI does not seem to get
fully updated. The foreground dialogs seem to update OK but the dialog
box in the background does not seem to be updated. I would also like to
allow the user to have a cancel button but when I try this in my sample
code, the button does not function till the method is complete.
I would like to make things as easy as possible for the end user
programmer. I am calling Yield() in my ATL OCX but that does not seem to
make a difference on the VB side. Should I spawn a thread to execute my
lengthy method? The problem I see with this is that the method would exit
while the method is not truly complete. I suppose I could have a Complete
event (which I already have) but that would mean the end user programmer
would have to remember to us this event to update their UI after the
method is complete. Is there an easier and better may I should be doing
this?
My guess is I really need a thread in the VB code to handle the dialog box
but I understand that threads do not work in VB6.
--
Bruce E. Stemplewski
GarXface OCX and C++ Class Library for the Garmin GPS
www.stempsoft.com
.
- Follow-Ups:
- Re: Who is responsible for refreshing the UI?
- From: Bruce E. Stemplewski
- Re: Who is responsible for refreshing the UI?
- References:
- Who is responsible for refreshing the UI?
- From: Bruce E. Stemplewski
- Who is responsible for refreshing the UI?
- Prev by Date: Re: iframe check
- Next by Date: Re: iframe check
- Previous by thread: Who is responsible for refreshing the UI?
- Next by thread: Re: Who is responsible for refreshing the UI?
- Index(es):
Relevant Pages
|