with Ada.Text_IO; package body Adadll is --------------------------------------- -- DLL initialization/finalization -- --------------------------------------- function DllMain (hInst : HINSTANCE; Reason : ULONG; Reserved : LPVOID) return BOOL is begin -- take the action for which we are called case Reason is -- a new process (_not_ thread) is attaching itself -- initialize the Ada runtime library for it when DLL_PROCESS_ATTACH => AdaInit; return True_BOOL; -- a process is unloading the dll -- finalize the Ada runtine library for it when DLL_PROCESS_DETACH => AdaFinal; return True_BOOL; -- in all other cases we simply return 'True' when others => return True_BOOL; end case; end DllMain; -------------------------------- -- just tell 'm we're there -- -------------------------------- procedure Junk is begin Ada.Text_IO.Put_Line ("Excuting procedure 'Junk' from Dll"); end Junk; ----------------------------------------------------------- -- display message and return the answer to everything -- ----------------------------------------------------------- function Junk_2 return Interfaces.C.int is begin Ada.Text_IO.Put_Line ("Now excuting function 'Junk_2' from Dll"); return 42; end Junk_2; -------------------------------------------------- -- display the value and return the value 100 -- -------------------------------------------------- function Junk_3 (Value : Interfaces.C.int) return Interfaces.C.int is begin Ada.Text_IO.Put ("function 'Junk_3' in Dll recieved the value:"); Ada.Text_IO.Put_Line (Integer'Image (Integer (Value))); return 100; end Junk_3; end Adadll;