Board index » delphi » MessageDlg in C++ Builder->Please help

MessageDlg in C++ Builder->Please help

Has anyone checked out this function in Builder?
   MessageDlg("FooBar",mtConfirmation,mbOK,0);
                                     ^^^^^^
The problem is here with a new Builder set type.
The compiler says "expression syntax".
No flames please, I know this isn't a builder
group, but after all, the VCL *is* Delphi.
{*word*106} Ritti [email protected]  

 

Re:MessageDlg in C++ Builder->Please help


Quote
R Richard Ritti wrote:

> Has anyone checked out this function in Builder?
>    MessageDlg("FooBar",mtConfirmation,mbOK,0);
>                                      ^^^^^^
> The problem is here with a new Builder set type.
> The compiler says "expression syntax".
> No flames please, I know this isn't a builder
> group, but after all, the VCL *is* Delphi.
>{*word*106} Ritti [email protected]

You'd want to do something like this...

Application->MessageBox("Not Implemented at this Time","Global
Dim",MB_OK);There's only three parameters here and this works.
--
        B. Sturk

Curator of the 'Unofficial Homepage for Borland C++ Builder'
http://www.nh.ultranet.com/~bsturk

'Whatever happened to Pong?' -- Frank Black (The Pixies)

Re:MessageDlg in C++ Builder->Please help


R Richard Ritti <[email protected]> wrote:

Quote
>Has anyone checked out this function in Builder?
>   MessageDlg("FooBar",mtConfirmation,mbOK,0);
>                                     ^^^^^^
>The problem is here with a new Builder set type.
>The compiler says "expression syntax".

The only way I've found to do a new set is
  TSetType mynewset;
  newset << mbOk;
(but surely there must be a shorter way of writing it!)

In any case, I always prefer Application->MessageBox(..)

--
Lucian Wischik, Queens' College, Cambridge CB3 9ET. [email protected]

Re:MessageDlg in C++ Builder->Please help


dick,
  I'm not sure if this would be a problem but in Delphi this sould be
written:
  MessageDlg('FooBar',mtConfirmation,[mbOK],0);

Note the [] around the mbOK.  I also changed the " " to ' ' but I doubt
this is your problem.

Hope this helps!
--
Rod Geraghty (:>)
GERA-Tech
Ottawa, Canada
[email protected]

R Richard Ritti <[email protected]> wrote in article <[email protected]>...

Quote
> Has anyone checked out this function in Builder?
>    MessageDlg("FooBar",mtConfirmation,mbOK,0);
>                                      ^^^^^^
> The problem is here with a new Builder set type.
> The compiler says "expression syntax".
> No flames please, I know this isn't a builder
> group, but after all, the VCL *is* Delphi.
>{*word*106} Ritti [email protected]  

Re:MessageDlg in C++ Builder->Please help


Quote
L.J. Wischik wrote:
> The only way I've found to do a new set is
>   TSetType mynewset;
>   newset << mbOk;
> (but surely there must be a shorter way of writing it!)

How about

TSetType() << mbOK

as the function parameter? i.e. create the temporary object inline.

Re:MessageDlg in C++ Builder->Please help


Quote
[email protected] (L.J. Wischik) wrote:
>R Richard Ritti <[email protected]> wrote:
>>Has anyone checked out this function in Builder?
>>   MessageDlg("FooBar",mtConfirmation,mbOK,0);
>>                                     ^^^^^^
>>The problem is here with a new Builder set type.
>>The compiler says "expression syntax".

>The only way I've found to do a new set is
>  TSetType mynewset;
>  newset << mbOk;
>(but surely there must be a shorter way of writing it!)

>In any case, I always prefer Application->MessageBox(..)

>--
>Lucian Wischik, Queens' College, Cambridge CB3 9ET. [email protected]

MessageDlg ("Hello", mtConfirmation, TMsgDlgButtons () << mbOk, 0);

Other Threads