AdaPower Logged in as Guest
Ada Tools and Resources

Ada 95 Reference Manual
Ada Source Code Treasury
Bindings and Packages
Ada FAQ


Join >
Articles >
Ada FAQ >
Getting Started >
Home >
Books & Tutorials >
Source Treasury >
Packages for Reuse >
Latest Additions >
Ada Projects >
Press Releases >
Ada Audio / Video >
Home Pages >
Links >
Contact >
About >
Login >
Back
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 win32-winmain.ads
   -- 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;
   
begin

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

end HelloWorld;


(c) 1998-2004 All Rights Reserved David Botton