Announcement

Collapse
No announcement yet.

PB9 Anomoly (Bug?)

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • PB9 Anomoly (Bug?)

    I've got DLL code that works when compiled with PB8, but crashes with PB9. After some putzing around, I've written the toy program below to demonstrate the problem.

    It crashes only when PB9 has a graphic window open, it has focus, and the mouse wheel gets scrolled. As this is an EXE rather than a DLL, the observable effect is that the program just abruptly terminates mid loop. With my original DLL the effect is rather uglier.

    I see this problem on two different machines, both running XP-Home. So my question is whether this is a known problem, and/or whether other people here can see the same effect on their hardware.

    Code:
    #COMPILE EXE
    #DIM ALL
    
    %WinPelHt = 300
    %WinPelWd = 400
    
    FUNCTION PBMAIN () AS LONG
        GLOBAL hWin AS DWORD   'handle for a graphics window to use for console output.
        DIM I       AS INTEGER
    
        GRAPHIC WINDOW "PB/DLL Optimization Routine", 0, 0, CLNG(%WinPelWd), CLNG(%WinPelHt) TO hWin
        GRAPHIC ATTACH hWin, 0
        GRAPHIC FONT "Lucinda Console",10,1
    
        FOR i = 1 TO 10
          SLEEP 1000
          GRAPHIC PRINT ("I =" & STR$(i))
        NEXT i
        MSGBOX "Waiting for key..."
        GRAPHIC WINDOW END
    
    END FUNCTION
    Thanks.

    Bill

  • #2
    Works fine here. WinXpHome SP3

    James

    Comment


    • #3
      Ms

      Works as expected here, no problems. WinME, PBWin 9.0

      Maybe you need to re-install 9.0 or have an AV that is interfering ...
      Rick Angell

      Comment


      • #4
        Originally posted by Richard Angell View Post
        Works as expected here, no problems. WinME, PBWin 9.0

        Maybe you need to re-install 9.0 or have an AV that is interfering ...
        Just so I fully understand. You are spinning your mouse wheel while the graphic window is counting up? And it still continues to count up to the full '10' without aborting mid count?

        Disabling my AV seems to have no effect. And I've already installed PB9 twice with the same effect.

        Bill

        Comment


        • #5
          And just for good measure, I copied the two EXE files over to a Vista computer and ran them there. The PB8 version runs to completion, while the PB9 version crashes when I spin the mouse wheel, and says "Windows has detected an error" along with a promise to inform me if Microsoft figures out the problem.

          Bill

          Comment


          • #6
            Running Vista I get your GPF. Have to click on the window first.
            Perhaps because there's no message handling outside the inherent graphics?

            And it works for me in PBWin 8.04
            Last edited by Rodney Hicks; 4 Nov 2008, 01:39 PM. Reason: add info
            Rod
            In some future era, dark matter and dark energy will only be found in Astronomy's Dark Ages.

            Comment


            • #7
              Yup, terminates on XP using ver 9.0 just as you describe. I replaced the sleep with a different delay to no avail. I wonder if it has to do with not handling the messages?

              Comment


              • #8
                I don't get a GPF message, but the program ends prematurely without the 'Waiting for key" message box when I scrolll the wheel.. so the system must have terminated it.

                Do I need to have some system setting to get GPF messages? I ask because over the weekend, too, I did not get a message when I know I should have gotten a stack fault GPF.

                Windows/XP Pro SP3 all updates via Win/9x IDE compile/run.

                Except today I DID get GPF message boxes from Lotus (it does not like the so-called "standard richtext" created by MS-Word. But it likes what Wordpad creates)

                MCM
                Michael Mattias
                Tal Systems (retired)
                Port Washington WI USA
                [email protected]
                http://www.talsystems.com

                Comment


                • #9
                  What type of mouse? Mine is a ps2 and I can't get it to gpf using the scroll wheel.

                  James

                  Comment


                  • #10
                    Compiled in 8.04 on XP Pro SP3 ---> No crash
                    Compiled in 9.00 on XP Pro SP3 ---> No crash ---> But Window disappears and messagebox appears on schedule.

                    So the program is not crashing, just disappearing from sight. I would look closer at what messages are you getting and what of those messages are you not handling and letting the OS handle it?
                    Engineer's Motto: If it aint broke take it apart and fix it

                    "If at 1st you don't succeed... call it version 1.0"

                    "Half of Programming is coding"....."The other 90% is DEBUGGING"

                    "Document my code????" .... "WHYYY??? do you think they call it CODE? "

                    Comment


                    • #11
                      Michael:

                      In my case, the toy program I posted does not produce an error message under XP - it just quietly terminates. The DLL version in which I originally encountered the problem did cause Excel to produce a Windows error message though.

                      But the toy program under Vista does cause Windows to produce an error message when it terminates.

                      Bill

                      Comment


                      • #12
                        >In my case, the toy program I posted does not produce an error message under XP - it >just quietly terminates

                        Yes, that is what I got.

                        But I would have liked to have gotten the 'full blown "WIndows has detected...."' screen. Over the weekend I would have seen a stack fault error and would not have had to code in the TRACE stuff - because as soon as I would have seen "stack fault" I would have known what the problem was. (Or what I was sure it "had to be"). (Which it was).

                        Fortunatately TRACE told me I had.... a stack fault problem, so at least I was able to find and fix it.
                        Michael Mattias
                        Tal Systems (retired)
                        Port Washington WI USA
                        [email protected]
                        http://www.talsystems.com

                        Comment


                        • #13
                          Crashes for me with PB9 and XP S2. The program also disappears from Task Manager/Processes as soon as it goes off the screen, so it is not hanging around.

                          Iain Johnstone
                          “None but those who have experienced them can conceive of the enticements of science” - Mary Shelley

                          Comment


                          • #14


                            Gee, doesn't the way this program is terminating sound like my aforementioned 'stack fault'?

                            But if it is, ain't nobody outside Venice FL gonna solve it, since demo program does not have but token access to the stack.
                            Michael Mattias
                            Tal Systems (retired)
                            Port Washington WI USA
                            [email protected]
                            http://www.talsystems.com

                            Comment


                            • #15
                              Ms

                              I did not try with a wheel mouse. If that is the ingredient here that triggers then send the code to [email protected]
                              Rick Angell

                              Comment


                              • #16
                                Now that I am home, I gave the same test again on a Vista machine, and without recompiling. Then I recompiled and tried again and the same results
                                Code:
                                Compiled in 8.04 on XP Pro SP3 ---> No crash
                                Compiled in 9.00 on XP Pro SP3 ---> No crash ---> But Window disappears and messagebox appears on schedule.
                                
                                So the program is not crashing, just disappearing from sight. I would look closer at what messages are you getting and what of those messages are you not handling and letting the OS handle it?
                                And now that I have a moment, I figured pretty interesting results, so I would throw my error handler at it, and all I got was no error. (Since I am still working on the handler, so I figured something I had not thought of yet, so I had an idea to add, BUTTTTT.....)

                                Reading the docs, I see nothing about callbacks, and from VERY limited knowledge of (what I thought was basically a picturebox on a dialog, but was wayyyy offfff....its more like a VB Form that I could print text to kinda thing)

                                Unless someone has an idea, (like Ricard said) I would submit to [email protected] and see what they say?

                                Seems odd to me to not be a "CRASH" (whatever that may actually mean), but more "Does not work as expected" (aka, it runs fine, but the "Dialog" disappears???)
                                Engineer's Motto: If it aint broke take it apart and fix it

                                "If at 1st you don't succeed... call it version 1.0"

                                "Half of Programming is coding"....."The other 90% is DEBUGGING"

                                "Document my code????" .... "WHYYY??? do you think they call it CODE? "

                                Comment


                                • #17
                                  No problem here. I spin the wheel up and down, press it. also all other mouse buttons. it works to completion.

                                  Windows XP Pro in Spanish / SP3
                                  Graphic Card: NVidia GeForce 6200 256Mb

                                  ADDED LATER ON:
                                  I closed the window while counting. The window closed and the program ran silently until completion (it shows the messagebox when done counting).
                                  Last edited by Pedro Ramirez; 4 Nov 2008, 06:10 PM.

                                  Comment


                                  • #18
                                    Not sure what it means but Pedro's post of
                                    ADDED LATER ON:
                                    I closed the window while counting. The window closed and the program ran silently until completion (it shows the messagebox when done counting).
                                    Until I can test with XP myself (guessing the same results), I ran your test on VISTA, and both the PB8 and PB9 compiled, and no scroll, but just close the window, they completed and then closed as you would expect (except they typical "I closed, Why is it still counting????" sort of thing)

                                    May help, may not, but its a piece of info we did not have before
                                    Engineer's Motto: If it aint broke take it apart and fix it

                                    "If at 1st you don't succeed... call it version 1.0"

                                    "Half of Programming is coding"....."The other 90% is DEBUGGING"

                                    "Document my code????" .... "WHYYY??? do you think they call it CODE? "

                                    Comment


                                    • #19
                                      Bill,

                                      The program terminates here as well ('PBWIN 9.00 - WinApi 05/2008 - XP Pro SP3). The same thing happens (mouse wheel exits immediately and quietly) in a graphics program I have been playing with (http://www.powerbasic.com/support/pb...ad.php?t=38601). Dominique pointed it out.

                                      After fooling with the program and getting nowhere, I just decided to make it a feature ("Mouse Wheel Exits Autiomatically") and move on.

                                      ============================
                                      "Dancing is silent poetry."
                                      Simonides (556-468bc)
                                      ============================
                                      It's a pretty day. I hope you enjoy it.

                                      Gösta

                                      JWAM: (Quit Smoking): http://www.SwedesDock.com/smoking
                                      LDN - A Miracle Drug: http://www.SwedesDock.com/LDN/

                                      Comment


                                      • #20
                                        Not sure if this is a feature or an issue Should be sent to support for a ruling.

                                        Meanwhile you can avoid the premature closing of the Graphic Window by capturing the wheel..
                                        Code:
                                        #COMPILE EXE
                                        #DIM ALL
                                        #INCLUDE "WIN32API.inc"
                                         
                                        %WinPelHt = 300
                                        %WinPelWd = 400
                                         
                                        GLOBAL GrStaticProc AS DWORD
                                         
                                        FUNCTION GrProc(BYVAL hWnd AS DWORD, BYVAL wMsg AS DWORD, BYVAL wParam AS DWORD, BYVAL lParam AS LONG) AS LONG
                                          SELECT CASE wMsg
                                         
                                            CASE %WM_MOUSEWHEEL
                                              EXIT Function 
                                         
                                          END SELECT
                                         FUNCTION = CallWindowProc(GrStaticProc, hWnd, wMsg, wParam, lParam)
                                        END FUNCTION
                                        '------------------/
                                         
                                        FUNCTION PBMAIN () AS LONG
                                            GLOBAL hWin AS DWORD   'handle for a graphics window to use for console output.
                                            DIM hStatic AS LONG
                                            DIM I       AS INTEGER
                                            DIM W       AS SINGLE
                                         
                                            GRAPHIC WINDOW "PB/DLL Optimization Routine", 0, 0, CLNG(%WinPelWd), CLNG(%WinPelHt) TO hWin
                                             hStatic = GetWindow(hWin, %GW_CHILD)               ' Retrieve handle (static child of of graphic window)
                                             GrStaticProc = SetWindowLong(hStatic, %GWL_WNDPROC, CODEPTR(GrProc)) ' Subclass to catch mouse messages etc
                                            GRAPHIC ATTACH hWin, 0
                                            GRAPHIC FONT "Lucinda Console",10,1
                                         
                                            FOR i = 1 TO 10
                                              GRAPHIC GET CLIENT TO W, W                        ' Has window closed? - exit For Next Loop
                                              IF W = 0 THEN GOTO CLEANUP
                                              SLEEP 1000
                                              GRAPHIC PRINT ("I =" & STR$(i))
                                            NEXT i
                                            MSGBOX "Waiting for key..."
                                         
                                        CLEANUP:
                                          SetWindowLong hStatic, %GWL_WNDPROC, GrStaticProc
                                          GRAPHIC WINDOW END
                                        END FUNCTION
                                        '------------------/
                                        Some discussion of mousing around in a graphic window here:
                                        Rgds, Dave

                                        Comment

                                        Working...
                                        X