comp.lang.ada
 help / color / mirror / Atom feed
* Directory Operations
@ 2008-11-03 16:27 andrei.krivoshei
  2008-11-03 17:33 ` Dmitry A. Kazakov
  2008-11-04 13:52 ` AndreiK
  0 siblings, 2 replies; 5+ messages in thread
From: andrei.krivoshei @ 2008-11-03 16:27 UTC (permalink / raw)


Hello.
I have a problem.
I need to write a DLL with a function, which returns the path to a
current directory under Windows XP.
I have't any problem with DLL itself, but when I try to use some
function from the package "GNAT.Directory_Operations" or
"Ada.Directories", I get the unexecutable DLL.
NOTE! The executable file is working, I talk only about DLL variant!

Thanks!

The code listing of my program is

========= Spec ============
with Interfaces.C.Strings; use Interfaces.C.Strings;

package FAD is

   procedure Pwd(Path_ptr: in out Chars_ptr );
   pragma Export(C, Pwd, "pwd");

end FAD;

========= Body ============
--  with Ada.Directories;
with Ada.Strings;
with GNAT.Directory_Operations;

package body FAD is
   package DOP renames GNAT.Directory_Operations;
   use Ada.Strings;

   procedure Pwd(Path_ptr: in out Chars_ptr ) is
--        use Ada.Directories;
      CStr: Chars_ptr;
      Path: String (1 .. 1024);
   begin
--      Path: String := "custom test string";  -- with this code line,
the DLL is executable
      Path := DOP.Get_Current_Dir;  -- with this code line, the DLL is
UNexecutable
      CStr := Null_Ptr; -- Value for test purposes only
      Path_ptr := CStr;
   end Pwd;

end FAD;



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2008-11-04 14:44 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-11-03 16:27 Directory Operations andrei.krivoshei
2008-11-03 17:33 ` Dmitry A. Kazakov
2008-11-04 12:57   ` AndreiK
2008-11-04 14:44     ` Dmitry A. Kazakov
2008-11-04 13:52 ` AndreiK

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox