Results 1 to 8 of 8

Thread: i cant think of a good subject

  1. #1

    Thread Starter
    Junior Member
    Join Date
    May 2001
    Posts
    21

    Post i cant think of a good subject

    Hi

    Is there a function in C++ that does the equivilent of the VB command DoEvents?
    (¯`·.¸¸.·´¯`·.:W!LL:.·´¯`·.¸¸.·´¯)

  2. #2
    Frenzied Member
    Join Date
    Jul 1999
    Posts
    1,800
    I've asked this before too and they told me to use Sleep(0); but it never worked....they said you have to use timers......yucky

  3. #3
    Frenzied Member Technocrat's Avatar
    Join Date
    Jan 2000
    Location
    I live in the 1s and 0s of everyones data streams
    Posts
    1,024
    From MSDN:

    A value of zero causes the thread to relinquish the remainder of its time slice to any other thread of equal priority that is ready to run. If there are no other threads of equal priority ready to run, the function returns immediately, and the thread continues execution.

    So yes it is like DoEvents in VB.
    MSVS 6, .NET & .NET 2003 Pro
    I HATE MSDN with .NET & .NET 2003!!!

    Check out my sites:
    http://www.filthyhands.com
    http://www.techno-coding.com


  4. #4

    Thread Starter
    Junior Member
    Join Date
    May 2001
    Posts
    21

    Question

    Sleep(0); doesnt work. What the problem is that my program has a while loop and the volume control on my keyboard doesnt work during the loop. The program is using DirectX and the program cooperation level is set to exclusive. How can I make the volume control and other things like that work while my program is in a loop?

    they said you have to use timers
    How would I do it with timers?
    (¯`·.¸¸.·´¯`·.:W!LL:.·´¯`·.¸¸.·´¯)

  5. #5
    Frenzied Member
    Join Date
    Jul 1999
    Posts
    1,800
    Never mind, you are doing something totally different that I was. I was moving an image accross the screen with a while loop, but there is nothing like DoEvents so they told me to use Timers instead of my whlie loop. But I've never used DX so it doesn't look like I'm of much help here. Good Luck though

  6. #6
    Frenzied Member Technocrat's Avatar
    Join Date
    Jan 2000
    Location
    I live in the 1s and 0s of everyones data streams
    Posts
    1,024
    I think that when you have cooperation level set to exclusive you cannot using anything in Windows that does not have a Direct X interface. If you want to control sound I believe that Direct Sound should have the needed interfaces.
    MSVS 6, .NET & .NET 2003 Pro
    I HATE MSDN with .NET & .NET 2003!!!

    Check out my sites:
    http://www.filthyhands.com
    http://www.techno-coding.com


  7. #7

    Thread Starter
    Junior Member
    Join Date
    May 2001
    Posts
    21
    My program has to be exclusive because it is full screen. Most other games that are full screen, still allow other windows things like the volume control to work. I think that to do that I need something like DoEvents or maybe it is done differently. I dont want my program to set the volume, I want the user to be able to change the volume.
    (¯`·.¸¸.·´¯`·.:W!LL:.·´¯`·.¸¸.·´¯)

  8. #8
    wossname
    Guest
    Why doesn't someone compile "DoEvents" inside a class into a DLL file using VB and then access the function that contains it. Then you can call it from C++!

    Heh heh heh, maybe not.

    ----------------------------
    On the VB bus leaning out of the window to admire the C++ soft-top in the next lane!

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