Top.Mail.Ru
Мастера DELPHI, Delphi programming community Титульная страница Поиск, карта сайта Написать письмо 
| Новости | Поиск | FAQ | Статьи | Книги | Новости VCL |
| Форумы ЧАТ | Орешник | KOL и MCK |
Форумы -» Основная («Начинающим»)/ Базы / WinAPI / Компоненты / Сети / Media / Игры / Corba и COM / KOL / FreePascal / .Net / Прочее / RSDN.ORG

« предыдущая ветвь | форум | следующая ветвь »

не компилируется MessageBox


xyz ©   (2009-07-30 18:49:00) 

Пишу:
application.MessageBox('This should be on top.', 'Look', [smbOK]);
Скопировано, кстати, из справки. Выдает ошибку: undeclared identifier: smbOK
Надо подключить какой-то модуль?


sniknik   (2009-07-30 23:00:00) [1]

надо было не просто Application, а CLX Application создавать в начале, чтобы примеры кросплатформенные использовать...
(а после посмотреть на размер и прослезиться... ;)


Медвежонок Пятачок   (2009-07-30 22:44:00) [2]

The following cross-platformcode ......

Этот пример общий, а не для Delphi конкретно.

function TApplication.MessageBox(const Text, Caption: PChar; Flags: Longint): Integer;

последний параметр - скалярный

http://img41.imageshack.us/img41/7233/80279570.jpg


xyz   (2009-07-30 21:52:00) [3]

Я вот что читал:


> Displays a specified message to the user.
>
> Delphi syntax:
>
> function MessageBox(const Text: WideString; const Caption:
>  WideString = ''; Buttons: TMessageButtons = [smbOK]; Style:
>  TMessageStyle = smsInformation; Default: TMessageButton
> = smbOK; Escape: TMessageButton = smbCancel): TMessageButton;
>  
>
> C++ syntax:
>
> TMessageButton __fastcall MessageBox(const WideString Text,
>  const WideString Caption, TMessageButtons Buttons = TMessageButtons()
> << smbOK, TMessageStyle Style smsInformation, TMessageButton
> Default = smbOK, TMessageButton Escape = smbCancel);
>
> Description
>
> Use MessageBox to display a generic dialog box a message
> and one or more buttons. Caption is the caption of the dialog
> box and is optional.
>
> The Text parameter is the message that appears in the dialog
> box.
>
> The Caption parameter is the caption that appears in the
> title bar of the dialog box..
>
> The Buttons parameter indicates what buttons appear in the
> message box.
>
> The Style parameter indicates the use of the message box.
>
>
> The Default parameter indicates which of the buttons in
> the Buttons parameter is clicked when the user types the
> space bar.
>
> The Escape parameter indicates which of the buttons in the
> Buttons parameter is clicked when the user types the escape
> key.
>
> MessageBox returns 0 if there isn’t enough memory to create
> the message box. Otherwise it returns the button that the
> user clicked.

и

> The following cross-platform code causes “stay on top” forms
> to allow a MessageBox to appear on top. After the message
> box is closed, the topmost forms are restored so that they
> continue to float to the top.
>
> Begin
>
>   with Application do
>   begin
>     NormalizeTopMosts;
>     MessageBox('This should be on top.', 'Look', [smbOK]);
>
>     RestoreTopMosts;
>   end;
> end;


Ну и где тут написано, что надо не smb, а mb писать?


Медвежонок Пятачок   (2009-07-30 19:02:00) [4]

Скопировано, кстати, из справки.

А ты на третье слово в первой строке этой справки обратил внимание?


palva   (2009-07-30 18:59:00) [5]


> Надо подключить какой-то модуль?

Ну это не обязательно. Можно самому определить.


Медвежонок Пятачок   (2009-07-30 18:56:00) [6]

надо стереть три символа и добавить один


Наверх

Титульная страница Поиск, карта сайта Написать письмо