flat assembler
Message board for the users of flat assembler.

Index > Windows > VB6-2-FASM: DoEvents...

Author
Thread Post new topic Reply to topic
cod3b453



Joined: 25 Aug 2004
Posts: 619
cod3b453
Hi

Just when I thought I had everything covered I find a DoEvents in my VB6 project Sad ... For those not familiar with it, it is supposed to allow all other threads to clear (process) their message queues before continuing, but I can't quite figure out how to do this.

Any help/clues/solutions would be extremely helpful.

thanks,

cod3b453
Post 05 Jul 2005, 20:49
View user's profile Send private message Reply with quote
Vasilev Vjacheslav



Joined: 11 Aug 2004
Posts: 392
Vasilev Vjacheslav
maybe WaitForSingleObject, MsgWaitForMultipleObjects or Sleep
Post 06 Jul 2005, 05:26
View user's profile Send private message Reply with quote
r22



Joined: 27 Dec 2004
Posts: 805
r22
SleepEx api is definetly what your looking for.
Code:
.DoEventsLabel:
...Your Code...
PUSH 0 ;event obj alertable = false
PUSH 0 ;millisecond delay (none just let other threads get slice)
CALL SleepEx
JMP .DoEventsLabel
    


OPTIMIZATION TIP (if you don't care about win9x TO xp/nt compat):
Always use the Ex suffixed or Nt/Rtl prefixed api's when possible because the shorter named functions call their Ex counterpart anyways.

You call VirtualAlloc
System call's VirtualAlloc WHICH call's VirtualAllocEx WHICH calls NtAllocateVirtualMemory
Post 06 Jul 2005, 17:19
View user's profile Send private message AIM Address Yahoo Messenger Reply with quote
cod3b453



Joined: 25 Aug 2004
Posts: 619
cod3b453
Thanks Vasilev Vjacheslav & r22!

I read the documentaton for Sleep[Ex] again and realised the bit about setting timeout to 0 Embarassed ... I must be going blind

I'll try that optimisation tip as well

thanks

cod3b453
Post 06 Jul 2005, 19:03
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.