Results 1 to 10 of 10

Thread: About the opposite of DoEvents???

  1. #1

    Thread Starter
    PowerPoster ThEiMp's Avatar
    Join Date
    Dec 2007
    Location
    Take The PCI Bus Across To The CPU!!
    Posts
    3,781

    About the opposite of DoEvents???

    Dear VBformers,

    I am working on some source code, that needs to finish before it could pass over to the next section of source code, after it, then so. Then however I am looking instead of the continue after the line has been executed into action, then i am looking at some process to wait until it has finished, before it could be able to pass over, then so...

    !! Thanks in advance !!
    I have a huge free products range, of computer software in which you can download using any kind of 64-Bit Web Browser. Also there is coming a Social Networking section that I am making on my Website...

    |Ambra Productions Inc. | The Black Sun Society | The Black Shield | Ambra College | Church of the Black Sun | Ambra Productions Inc's Homepage | Boomtick Event's Venues: Ambar Nightclub, Jack Rabbit Slim's, Villa Nightclub and Lucy's Bar | Pasta Ambra | Fish Feast Company | Wallet Wizard | Ambrose Liquor | Ambar Tavern |

    Do you wish to do unpaid work for me??? If so, the PM me on this Forum, and then we can get to work, programming for the future of computers go by the name of ThEiMp. This is my ghost writers name. Also my nickname, means that I am: The Imperial of the Technology Industry, so then to make it really short, I just then wrote: The Imp, which is where I get the nickname from...

  2. #2
    Frenzied Member
    Join Date
    Dec 2014
    Posts
    1,491

    Re: About the opposite of DoEvents???

    vb6 codes runs sequentially, so if you have
    - code lines
    - call functions (this will need to finish before it continues)
    - codes lines

    if you instead call a executable or a 3rd dll, theres the waitprocess apis u can use.

  3. #3

    Thread Starter
    PowerPoster ThEiMp's Avatar
    Join Date
    Dec 2007
    Location
    Take The PCI Bus Across To The CPU!!
    Posts
    3,781

    Re: About the opposite of DoEvents???

    I guess what i am getting is multi-threaded processes, which i guess you could call it, then so
    I have a huge free products range, of computer software in which you can download using any kind of 64-Bit Web Browser. Also there is coming a Social Networking section that I am making on my Website...

    |Ambra Productions Inc. | The Black Sun Society | The Black Shield | Ambra College | Church of the Black Sun | Ambra Productions Inc's Homepage | Boomtick Event's Venues: Ambar Nightclub, Jack Rabbit Slim's, Villa Nightclub and Lucy's Bar | Pasta Ambra | Fish Feast Company | Wallet Wizard | Ambrose Liquor | Ambar Tavern |

    Do you wish to do unpaid work for me??? If so, the PM me on this Forum, and then we can get to work, programming for the future of computers go by the name of ThEiMp. This is my ghost writers name. Also my nickname, means that I am: The Imperial of the Technology Industry, so then to make it really short, I just then wrote: The Imp, which is where I get the nickname from...

  4. #4
    PowerPoster Zvoni's Avatar
    Join Date
    Sep 2012
    Location
    To the moon and then left
    Posts
    2,632

    Re: About the opposite of DoEvents???

    One System to rule them all, One IDE to find them,
    One Code to bring them all, and to the Framework bind them,
    in the Land of Redmond, where the Windows lie
    ---------------------------------------------------------------------------------
    People call me crazy because i'm jumping out of perfectly fine airplanes.
    ---------------------------------------------------------------------------------
    For health reasons i try to avoid reading unformatted Code

  5. #5
    Frenzied Member
    Join Date
    Dec 2014
    Posts
    1,491

    Re: About the opposite of DoEvents???

    the purpose of multi-threading is to allow different threads to work separately, otherwise theres no point of using it.
    to wait for another thread to be done is useless. better to just use 1 thread.
    but, for example you have 2 threads.
    1 is the main program, the UI. the 2 is a processor for something.
    while the 2nd is working u can allow the user to go around the UI and do things, but, theres a "button", say: (show result) that if u press, it should wait until the 2nd thread is done.
    well. now, depends if you have control of the 2nd thread. u could have a communication between the 2, like a loop that is waiting until the process is done. so its not the opposite of Doevents, but actually a Doevents, a loop that will wait and only exit when process=done.

  6. #6
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    6,704

    Re: About the opposite of DoEvents???

    I'm not clear on why you'd jump into all the complexities of multi-threading, when you're going to wait on the second thread to finish anway. IMHO, the whole reason for multi-threading is so you can go on doing other stuff while the second thread does some heavy (time consuming) lifting.
    Any software I post in these forums written by me is provided “AS IS” without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. Please understand that I’ve been programming since the mid-1970s and still have some of that code. My contemporary VB6 project is approaching 1,000 modules. In addition, I have a “VB6 random code folder” that is overflowing. I’ve been at this long enough to truly not know with absolute certainty from whence every single line of my code has come, with much of it coming from programmers under my employ who signed intellectual property transfers. I have not deliberately attempted to remove any licenses and/or attributions from any software. If someone finds that I have inadvertently done so, I sincerely apologize, and, upon notice and reasonable proof, will re-attach those licenses and/or attributions. To all, peace and happiness.

  7. #7

    Thread Starter
    PowerPoster ThEiMp's Avatar
    Join Date
    Dec 2007
    Location
    Take The PCI Bus Across To The CPU!!
    Posts
    3,781

    Re: About the opposite of DoEvents???

    Crikey Moses
    I have a huge free products range, of computer software in which you can download using any kind of 64-Bit Web Browser. Also there is coming a Social Networking section that I am making on my Website...

    |Ambra Productions Inc. | The Black Sun Society | The Black Shield | Ambra College | Church of the Black Sun | Ambra Productions Inc's Homepage | Boomtick Event's Venues: Ambar Nightclub, Jack Rabbit Slim's, Villa Nightclub and Lucy's Bar | Pasta Ambra | Fish Feast Company | Wallet Wizard | Ambrose Liquor | Ambar Tavern |

    Do you wish to do unpaid work for me??? If so, the PM me on this Forum, and then we can get to work, programming for the future of computers go by the name of ThEiMp. This is my ghost writers name. Also my nickname, means that I am: The Imperial of the Technology Industry, so then to make it really short, I just then wrote: The Imp, which is where I get the nickname from...

  8. #8

    Thread Starter
    PowerPoster ThEiMp's Avatar
    Join Date
    Dec 2007
    Location
    Take The PCI Bus Across To The CPU!!
    Posts
    3,781

    Re: About the opposite of DoEvents???

    In Adobe Director, they use the term: go to the frame, which is able to pause the playback head to that position, which is something like i need to do here, then so???
    I have a huge free products range, of computer software in which you can download using any kind of 64-Bit Web Browser. Also there is coming a Social Networking section that I am making on my Website...

    |Ambra Productions Inc. | The Black Sun Society | The Black Shield | Ambra College | Church of the Black Sun | Ambra Productions Inc's Homepage | Boomtick Event's Venues: Ambar Nightclub, Jack Rabbit Slim's, Villa Nightclub and Lucy's Bar | Pasta Ambra | Fish Feast Company | Wallet Wizard | Ambrose Liquor | Ambar Tavern |

    Do you wish to do unpaid work for me??? If so, the PM me on this Forum, and then we can get to work, programming for the future of computers go by the name of ThEiMp. This is my ghost writers name. Also my nickname, means that I am: The Imperial of the Technology Industry, so then to make it really short, I just then wrote: The Imp, which is where I get the nickname from...

  9. #9
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    6,704

    Re: About the opposite of DoEvents???

    Just trying to actually answer the question, about the best I could come up with is that the opposite of DoEvents would be to "ignore the message pump" for some period of time.

    With that understanding, here's what I came up with:

    Code:
    
    Option Explicit
    '
    Private Declare Function PeekMessage Lib "user32" Alias "PeekMessageA" (lpMsg As Any, ByVal hWnd As Long, ByVal wMsgFilterMin As Long, ByVal wMsgFilterMax As Long, ByVal wRemoveMsg As Long) As Long
    Private Declare Function QueryPerformanceCounter Lib "kernel32" (lpPerformanceCount As Currency) As Long
    Private Declare Function QueryPerformanceFrequency Lib "kernel32" (lpFrequency As Currency) As Long
    '
    
    Private Sub Form_Activate()
        IgnoreMsgPump 10000
    End Sub
    
    
    Public Sub IgnoreMsgPump(ForMilliSeconds As Long) ' Opposite of DoEvents?
        Dim cFreq As Currency
        Dim cValue As Currency
        Dim dStart As Double
        Dim Msg(6) As Long
        '
        QueryPerformanceFrequency cFreq
        QueryPerformanceCounter cValue
        dStart = cValue / cFreq
        Do
            PeekMessage Msg(0), 0&, 0&, 0&, 1&
            QueryPerformanceCounter cValue
        Loop While (cValue / cFreq - dStart) < (ForMilliSeconds / 1000#)
    End Sub
    
    
    
    Now again, I'm not sure why you'd do this, but that'll do it. Also, it'd be a bit rude to actually do that, as you can't even move the form while ignoring Windows messages.

    Another (similar) approach might be to ignore just keyboard and mouse input. The above could fairly easily be modified to do that by altering the range of messages tossed (third and fourth arguments of PeekMessage). And then, if you wanted to get really fancy, you could check the mouse events and make sure they applied to the client area, and, if not, pass them along.
    Last edited by Elroy; Sep 20th, 2021 at 07:11 PM.
    Any software I post in these forums written by me is provided “AS IS” without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. Please understand that I’ve been programming since the mid-1970s and still have some of that code. My contemporary VB6 project is approaching 1,000 modules. In addition, I have a “VB6 random code folder” that is overflowing. I’ve been at this long enough to truly not know with absolute certainty from whence every single line of my code has come, with much of it coming from programmers under my employ who signed intellectual property transfers. I have not deliberately attempted to remove any licenses and/or attributions from any software. If someone finds that I have inadvertently done so, I sincerely apologize, and, upon notice and reasonable proof, will re-attach those licenses and/or attributions. To all, peace and happiness.

  10. #10

    Thread Starter
    PowerPoster ThEiMp's Avatar
    Join Date
    Dec 2007
    Location
    Take The PCI Bus Across To The CPU!!
    Posts
    3,781

    Re: About the opposite of DoEvents???

    How am i able to work it into the inflation of a binary file, like a MKV file, then so???
    I have a huge free products range, of computer software in which you can download using any kind of 64-Bit Web Browser. Also there is coming a Social Networking section that I am making on my Website...

    |Ambra Productions Inc. | The Black Sun Society | The Black Shield | Ambra College | Church of the Black Sun | Ambra Productions Inc's Homepage | Boomtick Event's Venues: Ambar Nightclub, Jack Rabbit Slim's, Villa Nightclub and Lucy's Bar | Pasta Ambra | Fish Feast Company | Wallet Wizard | Ambrose Liquor | Ambar Tavern |

    Do you wish to do unpaid work for me??? If so, the PM me on this Forum, and then we can get to work, programming for the future of computers go by the name of ThEiMp. This is my ghost writers name. Also my nickname, means that I am: The Imperial of the Technology Industry, so then to make it really short, I just then wrote: The Imp, which is where I get the nickname from...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width