"MessageBoxA" error

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Charlie@CBFC

    "MessageBoxA" error

    Hi:

    Using messagebox class, I'm getting error saying "MessageBox A is not a class
    or namespace". I'm simply calling MessageBox class in a button event this
    so:

    private: System::Void button1_Click(S ystem::Object * sender,
    System::EventAr gs * e)
    {
    getExistingRace * per = new getExistingRace (); // modal form for selecting
    an existing race record
    if (per->ShowDialog() == DialogResult::O K)
    {
    MessageBox::Sho w(S"click OK button");
    }
    }

    If intellisense is correctly displaying MessageBox props, then I must be
    using correct namespace. What the heck is a MessageBoxA class?

    Thanks,
    Charlie


  • edx

    #2
    Re: "MessageBo xA" error

    You need to put

    #undef MessageBox

    somewhere at the beginning of your code (after the #include directives is
    best, I guess) because MessageBox is still defined from the native code.

    Regards,
    Felix Arends


    "Charlie@CB FC" <charle1@comcas t.net> wrote in message
    news:%23Qy3zAMa DHA.2256@TK2MSF TNGP10.phx.gbl. ..[color=blue]
    > Hi:
    >
    > Using messagebox class, I'm getting error saying "MessageBox A is not a[/color]
    class[color=blue]
    > or namespace". I'm simply calling MessageBox class in a button event this
    > so:
    >
    > private: System::Void button1_Click(S ystem::Object * sender,
    > System::EventAr gs * e)
    > {
    > getExistingRace * per = new getExistingRace (); // modal form for[/color]
    selecting[color=blue]
    > an existing race record
    > if (per->ShowDialog() == DialogResult::O K)
    > {
    > MessageBox::Sho w(S"click OK button");
    > }
    > }
    >
    > If intellisense is correctly displaying MessageBox props, then I must be
    > using correct namespace. What the heck is a MessageBoxA class?
    >
    > Thanks,
    > Charlie
    >
    >[/color]


    Comment

    • edx

      #3
      Re: &quot;MessageBo xA&quot; error

      Depends on what headers you include. If you include <windows.h> it sure is
      defined.

      Regards,
      Felix Arends
      [color=blue]
      > Thanks Felix, it worked. The interesting thing is error doesn't occurr on
      > all forms in my project.
      >
      > Charlie[/color]



      Comment

      Working...