No announcement yet.

PBCC 5.0 program terminates when mouse scroll wheel is moved?

  • Filter
  • Time
  • Show
Clear All
new posts

  • PBCC 5.0 program terminates when mouse scroll wheel is moved?


    I sent my brother a program earlier this afternoon, that I wrote with my new compiler, PBCC version 5.0. He tells me that every time he moves his mouse scroll wheel, whether accidentally or intentionally, the program immediately ends.

    The entire program uses mouse and keyboard input in a graphic window. (I'm surpressing the console completely.)

    I can't think of anything I'm doing in the program that would cause this. I'm not checking for any kind of scroll wheel movement. All I'm checking for is to see if the mouse has been clicked with Graphic Window Click statement.

    Right now I can't even test this at my end since my mouse doesn't have a scroll wheel. (I'm going to have to either borrow one or buy one.)

    Does anyone have an idea what might be happening and more importantly, what I might be able to do to fix it?

    As always, thanks to eveyone in advance for their replies.

  • #2
    I jsut read this in the PBCC 5 help file:

    "Due to limitations imposed by the Microsoft Windows operating system, it is not possible to trap the mouse wheel events in a console application."

    I don't wish to trap any events... I just don't want my program to crash.


    • #3
      That appears to be a known issue. Apparently there is a workaround, see this thread: See Dave Biggs post, #20.


      • #4
        This is a known issue which has been corrected in a maintenance update which will be available very soon. If you have any problem implementing the workaround (for now), please email [email protected] and they'll get you assistance promptly. Thanks!

        Bob Zale
        PowerBASIC Inc.


        • #5
          Thanks. That work-around doesn't compile under PBCC 5.0 (I received an error message) but hopefully it's something simple. I'm out the door so I'll look at the program more closely when I get home from work this evening and try to figure out how I will include that code in my program. (I noticed it's using the WIN32API include file, something my program isn't doing, but I suppose that's okay, as long as it fixes the problem.)


          • #6
            Mouse wheel crashing program


            Take a look at post #144 Graphic Console Menu for a simple subclassing technique to solve your problem and also improve your input loop using GRAPHIC INKEY$.
            Check MainMenuInput section.
            All you have to do is add the code I used before your FUNCTION PBMAIN () AS LONG instruction and you will trap all the Mouse and Keyboard events.
            You are welcome to use the menu too if you want.
            Old QB45 Programmer


            • #7
              Got it... thanks.

              Thank you Chris and Bob and Guy.

              Looking at the code posted from Guy and Bob (Biggs) I was successful in getting my program to capture the mouse wheel and not end.

              I'm glad I discovered this bug early. I would hate to discover it after writing a few dozen or so programs, knowing they ALL were capable of immediately ending with a simple mouse wheel scroll!

              Bob, I'm curious... how soon is 'very soon?' (Re: the maintenance update.)