Announcement

Collapse
No announcement yet.

Possible PB 9.0 'Bug'

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

  • Possible PB 9.0 'Bug'

    The code below compiles and excutes correctly under PB 8.04. Under PB 9.0 it causes my program to crash while the GUI is painting. If this code is commented out my program compiles and runs correctly but without the trackbars.

    Code:
        CONTROL ADD "msctls_trackbar32", hDlg, %SliderB1, "", 316 + %OffsetX, 780 + OffsetY, 152, 50, %WS_CHILD OR %WS_VISIBLE OR %WS_TABSTOP OR %TBS_HORZ OR %TBS_NOTICKS OR %TBS_TOOLTIPS, 0 ,CALL SliderB1
        CONTROL SEND hDlg, %SliderB1, %TBM_SETRANGE, -1, MAKDWD(00,100)
        CONTROL SEND hDlg, %SliderB1, %TBM_SETPOS, -1, 50
        CONTROL SET COLOR hDlg, %SliderB1, 0, RGB(0,111,255)

  • #2
    Walter,
    Although I thought that giving the callback function and a literal the same name might be tempting fate, putting this code into an otherwise empty DDT dialog does not create any problems for me on 8.04 or 9.

    Comment


    • #3
      Same here.
      Post some compilable code that shows the problem.
      Rgds, Dave

      Comment


      • #4
        >causes my program to crash

        "Crash???"

        - Program does not behave as expected?
        - Program behaves as expected but does not create expected output?
        - Program terminates prematurely on unexpected application error?
        - Program terminates on a system error, eg, a general protection fault?

        You'd think programmers - who deal with weak explanations of problems from Real Users every day - would be able to avoid subjective terms such as 'crash' when themselves asking for help.
        Michael Mattias
        Tal Systems (retired)
        Port Washington WI USA
        [email protected]
        http://www.talsystems.com

        Comment


        • #5
          Common Controls library initialized for trackbars? (code not shown).

          Usng SDK style code technique, that usually results in the control not being created, which I have to believe would mess up the DDT "paint screen" routine.

          That would not explain "works when compiled with one compiler version but not the other" but hey, it's worth doing anyway.
          Michael Mattias
          Tal Systems (retired)
          Port Washington WI USA
          [email protected]
          http://www.talsystems.com

          Comment


          • #6
            Mea Culpa

            the possible PB9 'bug' I reported appears to due to my use of a separate callback for the slider. Commenting out the slider's callback allowed the program to compile and execute, with the exception of the slider, correctly.

            If rewriting my program to use a single callback does not solve the problem, I'll post a compileable piece of code.

            Comment


            • #7
              > CONTROL SET COLOR hDlg, %SliderB1, 0, RGB(0,111,255)

              Is "CONTROL SET COLOR" even valid for a "CONTROL ADD ClassName" control?
              I would think not; but if not, that should have gotten flagged at compile time as an error.

              Also, trackbars communicate to owner window via WM_NOTIFY, so you would need #MESSAGES NOTIFY metastatement at compile time (Code not shown) to 'do something' with a control-level callback.

              The "#MESSAGES" thing is totally moot if you just process notifications under WM_NOTIFY in the owner window, eschewing the "control level callback."
              Michael Mattias
              Tal Systems (retired)
              Port Washington WI USA
              [email protected]
              http://www.talsystems.com

              Comment


              • #8
                "Is "CONTROL SET COLOR" even valid for a "CONTROL ADD ClassName" control?
                I would think not; but if not, that should have gotten flagged at compile time as an error."

                In this CONTROL SET COLOR allows the slider's background color to be matched to the dialog's background color. the color of the slider itself and the slot it rides in does not change.

                Comment

                Working...
                X