Announcement

Collapse
No announcement yet.

Misbehavior of a Callback

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

  • Misbehavior of a Callback

    Hi,

    I'm having some troubles w/ callbacks, I think. I have isolated the code to what follows.

    My main dialog calls an included .bas file which displays a data input dialog. When the user is satisfied with the data on that dialog, he can press the "Accept" button, which saves the data to a global array, executes the following *post* back to the main dialog, and closes quite gracefully.

    '+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=

    DIALOG POST TheMainDialog, %WM_USER + 500, 0, 0
    '+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=

    Back in the Main Dialog the following Case intercepts the post, which I can tell that it does when I uncomment the "MSGBOX" line, and the balance of the Case works fine. When I comment the "MSGBOX" line, however, it decides it can skip the rest of the active commands in the dialog. The SLEEP command seems to have no effect on the problem one way or another... I put it in to see if it needed more time to do *something*.

    '+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=
    CASE %WM_USER + 500
    ' msgbox "Info Accepted"
    ' sleep 1000

    DrawMap CBHNDL
    DIALOG SET TEXT CBHNDL, "ChiliDogs"

    FUNCTION = 1
    '+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=

    I have no good way of knowing if this is normal behavior or not...

    Ken
    Ken S. Elvehjem
    [email protected]

  • #2
    It's not normal behavior, unless you coded it that way.

    In shown code, on processing of the WM_USER+500 notification message, the DrawMap, DIALOG SET TEXT and FUNCTION= statements will be executed and the program will proceed to the first line of the program following the END SELECT (of CBMSG). Period.

    If the shown code is not the actual code, no bet.
    Michael Mattias
    Tal Systems Inc. (retired)
    Racine WI USA
    [email protected]
    http://www.talsystems.com

    Comment


    • #3
      Michael,

      Thanks for the response. I can deal with what it's doing now that I know that it isn't normal behavior... I just couldn't quite figure out why the "MSGBOX" statement made a difference.

      It's likely that I am using an external library that is giving me grief.

      Sincerely,

      Ken
      Ken S. Elvehjem
      [email protected]

      Comment


      • #4
        I advise against using a message box in any call back function for testing.
        Use Trace.

        James

        Comment


        • #5
          Or use STDOUT:

          Simple STDOUT for PB/DLL and PB/Win 2-13-04

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

          Comment


          • #6
            Originally posted by Michael Mattias View Post
            Add to my toolbox. Boy I was away a long time. Missed some good code.

            James

            Comment

            Working...
            X