Announcement

Collapse

New Sub-Forum

In an effort to help make sure there are appropriate categories for topics of discussion that are happening, there is now a sub-forum for databases and database programming under Special Interest groups. Please direct questions, etc., about this topic to that sub-forum moving forward. Thank you.
See more
See less

Msgbox in a Callback.

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

  • Msgbox in a Callback.

    Should this be avoided?

    Hi,
    In my program, in a %CBN_CLOSEUP message, I have placed two calls in row to the same function(different parameters) and one call to a second function. The functions reads data from two files.

    Values collected from the files is then displayed in some controls, among them 3 listview controls. The controls is located on a one paged Tabcontrol with its own callback, and it all works fine until a Msgbox call is placed before call to the functions. Then no controls is updated with the new data values.

    Anyone any clue?





  • #2
    Question is - why CBN_CLOSEUP? MS speaks, "In general, you cannot predict the order in which notifications will be sent. In particular, a CBN_SELCHANGE notification message may occur either before or after a CBN_CLOSEUP notification message."

    So maybe when focus shifts to MSGBOX, it intercepts selection / closeup notifycations. If MSGBOX is necessary, maybe can try acting on CBN_SELCHANGE instead and see if that helps.

    Comment


    • #3
      You may be experiencing a re-entry problem with MSGBOX, code not shown, LOCAL variables may be being reset on re-entry. Borje's suggestion should work, if that's the case.
      Rod
      I want not 'not', not Knot, not Knott, not Nott, not knot, not naught, not nought, but aught.

      Comment


      • #4
        To Borje:
        Sorry, didn't work, but I got it to work now. To share an issue with someone always inspires to try harder.

        In addition to what explained I also had code to save existing values in the controls under %CBN_Setfocus, and as said before, loaded new values under %cbn_closeup. Saving for one weekday and load for a different one.

        The weekday variable is a static one and caused the problem.

        Now I have placed a control get text... in the %CBN_DropDown to fetch current weekday showing in the combobox(saving) and the same call before fetching the new values.

        Both saving and fetching data is now placed under the %CBN_SelEndOk message.

        Very odd that there was no problem without the Msgbox.

        Thanks for support.
        --




        Comment


        • #5
          You may be experiencing a re-entry problem with MSGBOX, code not shown, LOCAL variables may be being reset on re-entry
          Ditto.

          If you want to add some "display information for debugging purposes" without re-entrancy issues like this you might just want to add a STDOUT function as shown in this demo:

          Simple STDOUT for PB/DLL and PB/Win 2-13-04
          Michael Mattias
          Tal Systems Inc. (retired)
          Racine WI USA
          [email protected]
          http://www.talsystems.com

          Comment

          Working...
          X