Announcement

Collapse
No announcement yet.

problem with buttons and labels

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

  • problem with buttons and labels

    Compiler PBDLL60
    I've a dialog, containing 3 text labels and 3 buttons.
    One button serves to end the dialog (OK-button). The other two are supposed to place text in 2 of the 3 labels. Those labels are empty on start-up. After clicking one of the buttons for the first time, the supposed text correctly appears in the labels. Then clicking the other button, only one of the 2 labels shows up with different text and then the application hangs. Even the OK-button does not work anymore, nor does the closebox in the right upper corner of the window, so I'm forced to use Task Mananger to end the app.

    Someone having any idea of what can be wrong? To be more specific: I'm using 3 different callback functions for each of the buttons plus a general call back to initialize the dialog.



    [This message has been edited by Egbert Zijlema (edited January 06, 2000).]

    Egbert Zijlema, journalist and programmer (zijlema at basicguru dot eu)
    http://zijlema.basicguru.eu
    *** Opinions expressed here are not necessarily untrue ***

  • #2
    Can we see the code please Egbert? Thanks!

    -------------
    Lance
    PowerBASIC Support
    ( mailto:[email protected][email protected]</A> )
    Lance
    mailto:[email protected]

    Comment


    • #3
      Lance,

      I've sent you the code by e-mail. The app. is too large to publish it here. In the meantime I've modified the callback for the buttons. There is one BtnCallBack now, using btnMsg = CBCTL, followed by a SELECT CASE. This does not solve the problem, however.

      For the time being I've made a criple workaround. After clicking on one of the buttons both are disabled. The only thing the user can do next (and finally) is clicking on the OK-button to end the app. Not very elegant, is'nt it?

      Regards and best wishes for the final year of this 999 years old millennium.

      [This message has been edited by Egbert Zijlema (edited January 06, 2000).]

      Egbert Zijlema, journalist and programmer (zijlema at basicguru dot eu)
      http://zijlema.basicguru.eu
      *** Opinions expressed here are not necessarily untrue ***

      Comment


      • #4
        Egbert, the problem with your code is that one of your callbacks calls the function...

        FUNCTION JaargangNummer(begin AS LONG, final AS LONG) AS LONG

        ... and this function sometimes gets stuck in an infinite loop. This "freezes" the app, because the callback never terminates.

        -------------
        Lance
        PowerBASIC Support
        ( mailto:[email protected][email protected]</A> )
        Lance
        mailto:[email protected]

        Comment


        • #5
          Lance,
          I've sent you already my thanks by e-mail, but want to do it here as well. Indeed the routine fell in an endless loop, due to the fact that its params were not declared 'BYVAL' and so the original variables became modified.

          Stupid to forget these basic BASIC-things.
          Sorry for stealing your time and thanks again.
          Problem solved!

          Egbert Zijlema, journalist and programmer (zijlema at basicguru dot eu)
          http://zijlema.basicguru.eu
          *** Opinions expressed here are not necessarily untrue ***

          Comment

          Working...
          X