MessageDlg Undeclared Identifier

MessageDlg Undeclared Identifier

Post by Paul » Sun, 31 Dec 1899 09:00:00



Trying to bring up a MessageDlg before closing table. Compiler error;
Undeclared Identifier: 'mbYesNo'.
How and where should I make this declaration?
I'm a newbie, so a code snippet/small example will explain better.
Thanks, Paul.
==============================================================
procedure TForm2.Table1BeforeClose(DataSet: TDataSet);
begin
if (Table1.State = dsEdit) or (Table1.State = dsInsert) then
 begin
   if MessageDlg('Post changes before closing?', mtConfirmation, mbYesNo,
0) = mrYes then
     Table1.Post
   else
     Table1.Cancel;
 end;
end;
===============================================================

 
 
 

MessageDlg Undeclared Identifier

Post by Reid Roma » Sun, 31 Dec 1899 09:00:00



> Trying to bring up a MessageDlg before closing table. Compiler error;
> Undeclared Identifier: 'mbYesNo'.
> How and where should I make this declaration?
> I'm a newbie, so a code snippet/small example will explain better.
> Thanks, Paul.
> ==============================================================
> procedure TForm2.Table1BeforeClose(DataSet: TDataSet);
> begin
> if (Table1.State = dsEdit) or (Table1.State = dsInsert) then
>  begin
>    if MessageDlg('Post changes before closing?', mtConfirmation, mbYesNo,
> 0) = mrYes then
>      Table1.Post
>    else
>      Table1.Cancel;
>  end;
> end;
> ===============================================================

Did you add "Dialogs" to your uses statement?

Rkr
--

          \|||/
          /'^'\
         ( 0 0 )
-----oOOO--(_)--OOOo----------
Reid Roman
E-Mail : rkroman (at) pacbell (dot) net
Delphi Enthusiast, Hobbyist ..
TVisualBasic:=class(None);
U.S.A
------------------------------

 
 
 

MessageDlg Undeclared Identifier

Post by Dan Brenna » Sun, 31 Dec 1899 09:00:00



Quote:>Trying to bring up a MessageDlg before closing table. Compiler error;
>Undeclared Identifier: 'mbYesNo'.
>How and where should I make this declaration?
>I'm a newbie, so a code snippet/small example will explain better.
>Thanks, Paul.
>==============================================================
>procedure TForm2.Table1BeforeClose(DataSet: TDataSet);
>begin
>if (Table1.State = dsEdit) or (Table1.State = dsInsert) then
> begin
>   if MessageDlg('Post changes before closing?', mtConfirmation, mbYesNo,
>0) = mrYes then
>     Table1.Post
>   else
>     Table1.Cancel;
> end;
>end;
>===============================================================

Paul,

This is one of those subtle syntax problems. The third parameter in a
messagedlg must be an array. There are some predefined arrays such as
mbYesNoCancel, which are put in without brackets. You need something
other than a predefined array, so put them in as an array:
(...mtConfirmation, [mbYes, mbNo], 0)
Even if you want only one button, it must be in [brackets].

Dan
CMDC systems
Configuration Management and Document Control Consultants
Software and Training

 
 
 

MessageDlg Undeclared Identifier

Post by Bill Dia » Sun, 31 Dec 1899 09:00:00


You must enclose mbYesNo in brackets [mbYesNo]

Bill

Quote:> > Trying to bring up a MessageDlg before closing table. Compiler error;
> > Undeclared Identifier: 'mbYesNo'.
> > How and where should I make this declaration?
> > I'm a newbie, so a code snippet/small example will explain better.
> > Thanks, Paul.
> > =============================================================

 
 
 

1. 'IXMLElementNotificationSink' : undeclared identifier

All,

I'm running win2k w/ VC++ 6 SP5.  I had a file msxml.h in my C:\Program
Files\Microsoft Visual Studio\VC98\Include folder which was 48KB large and
was created on 23/April/1998.  I renamed this to msxml.h and then copied
over a newer version of msxml.h which is 488KB large and was last modofied
on 3/Oct/2000.   This solved a number of problems for one application but on
revisiting an old 'reliable' application i get the perculiar error message.

'IXMLElementNotificationSink' : undeclared identifier

Can anyone tell me what i need to do to get my code to compile i.e. How do i
resolve this error?.

Sorry to cross-post
MA

2. SuperBase

3. ODBC_CONFIG_SYS_DSN undeclared identifier

4. To O/R or not to O/R, that is the question

5. parcels.pas(52): Undeclared identifier: 'Package'

6. 255 characters returned from SQL server.

7. Extended stored procedure compilation error, ODS_VERSION : undeclared identifier.

8. SQL 2000 SP3 fails Use SQL Auth. Right password for SA account

9. HELP: error C2065 "ERROR" undeclared identifier

10. ADOError Class as undeclared identifier?????

11. srv_paraminfo: undeclared identifier

12. Extended stored procedure compilation error, ODS_VERSION : undeclared identifier.

13. Undeclared identifier: dsEdit??