AdaPower Logged in as Guest
Ada Tools and Resources

Ada 95 Reference Manual
Ada Source Code Treasury
Bindings and Packages

Join >
Home >
Articles >
Getting Started >
Ada FAQ >
Source Treasury >
Books & Tutorials >
Packages for Reuse >
Latest Additions >
Ada Projects >
Press Releases >
Ada Audio / Video >
Home Pages >
Links >
Contact >
About >
Login >
Hello World Dialog (David Botton)

with win32.WinUser; use win32.WinUser;
with Interfaces.C; use Interfaces.C;
with Ada.Unchecked_Conversion;
with System;

procedure HelloWorld is

   -- Just in case you were wondering, the WinMain function is replaced
   -- with a package called Win32.WinMain (Take a look at
   -- for more information.

   function To_LPCSTR is new Ada.Unchecked_Conversion (System.Address, Win32.LPCSTR);

   Message  : Char_Array := To_C("Hello World!");
   Title    : Char_Array := To_C("Hello Program");
   RetValue : Win32.Int;

   RetValue:=MessageBox(System.Null_Address, To_LPCSTR(Message'Address), To_LPCSTR(Title'Address), 0);

end HelloWorld;

(c) 1998-2004 All Rights Reserved David Botton