Announcement

Collapse
No announcement yet.

MsgBox vs Messagebox

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

  • MsgBox vs Messagebox

    I have stumbled upon a situation that I can not explain/understand.

    Can someone please explain this?

    Code:
    '    Dialog Show Modal hDlg, Call ShowDIALOG8Proc To lRslt
        Dialog Show Modeless hDlg, Call ShowDIALOG8Proc To lRslt
        MessageBox hDlg, "Messagebox - result = " + Str$(lRslt), "RB", %mb_ok
        MsgBox "MsgBox - result = " + Str$(lRslt), %mb_taskmodal, "RB"
    If the code above is executed I get both messages, From MessageBox as well as from MsgBox.

    However if I execute this:
    Code:
        Dialog Show Modal hDlg, Call ShowDIALOG8Proc To lRslt
    '    Dialog Show Modeless hDlg, Call ShowDIALOG8Proc To lRslt
        MessageBox hDlg, "Messagebox - result = " + Str$(lRslt), "RB", %mb_ok
        MsgBox "MsgBox - result = " + Str$(lRslt), %mb_taskmodal, "RB"
    There is only one message, the one from MsgBox,
    The MessageBox one disappeared, went for a "walk", or just refuses to do something

    Anybody have any ideas?

    It is not so important in the context of this example, but I am sure there must be a valid explanation for it.
    Some basic principle that I am unaware of, that will sneak up and bite when least expected.
    Andre Jacobs
    "The problem with Computers is that they do what you tell them, not what you want them to"

  • #2
    Invalid parent handle (hDlg) since by then the modal dialog would have been destroyed.

    A quick check with GetLastError would have told you that . MSGBOX does not have a parent thus is not affected.
    kgpsoftware.com | Slam DBMS | PrpT Control | Other Downloads | Contact Me

    Comment


    • #3
      Thanks Kev,

      I knew it had to be something obvious, sometimes when one is too close to the situation, the obvious is missed.

      Then again if nothing goes wrong, then there is nothing to learn.
      Andre Jacobs
      "The problem with Computers is that they do what you tell them, not what you want them to"

      Comment

      Working...
      X