Re: Semi-multithreaded application in VB6
- From: "Steve Gerrard" <mynamehere@xxxxxxxxxxx>
- Date: Fri, 16 Dec 2005 22:39:16 -0800
"Matthias Julius" <jnews@xxxxxxxxxxxxxx> wrote in message
news:uslsszz0c.fsf@xxxxxxxxxxxxxxxxx
> "Steve Gerrard" <mynamehere@xxxxxxxxxxx> writes:
>
>> Question for you: where are you doing your DoEvents? The user won't be able
>> to
>> intervene except where you yield enough to let a button click get through.
>> That
>> would seem to be the place for your flag check as well.
>
> There are a number of wait times in the cycle. You are raising a good
> point here. If there is only a chance of a click event to get through
> during those wait times it doesn't make sense to check this flag.
>
> But, there is also a sub called by a timer periodically that might set
> it. I presume your point is true for timer events as well.
>
Yup, the timer control event won't fire until you call DoEvents or the current
executing process finishes.
> And there are calls to dll functions that take some time to complete.
> I don't know whether they block processing of events or not.
>
Generally yes.
I have a program that does some long distance file copying over the network at
work. It copies files in blocks, with a DoEvents after each block to update
progress and allow cancelling. For some locations, this can mean 10 seconds may
go by before the copying actually gets cancelled. For this kind of operation,
though, I think that is reasonable.
I would go with a main loop that did one large step of the process in each
cycle, followed by one DoEvents and flag check. Make the steps big enough that
you are checking only every 3 seconds or so; that would give a reasonable cancel
response, without bogging your code down with endless checking.
.
- Follow-Ups:
- Re: Semi-multithreaded application in VB6
- From: Matthias Julius
- Re: Semi-multithreaded application in VB6
- References:
- Semi-multithreaded application in VB6
- From: Matthias Julius
- Re: Semi-multithreaded application in VB6
- From: J French
- Re: Semi-multithreaded application in VB6
- From: Matthias Julius
- Re: Semi-multithreaded application in VB6
- From: J French
- Re: Semi-multithreaded application in VB6
- From: Matthias Julius
- Re: Semi-multithreaded application in VB6
- From: Steve Gerrard
- Re: Semi-multithreaded application in VB6
- From: Matthias Julius
- Semi-multithreaded application in VB6
- Prev by Date: Re: Install MSDN on different drive?
- Next by Date: Re: Semi-multithreaded application in VB6
- Previous by thread: Re: Semi-multithreaded application in VB6
- Next by thread: Re: Semi-multithreaded application in VB6
- Index(es):
Relevant Pages
|