comp.lang.ada
 help / color / mirror / Atom feed
From: AndreiK <andrei.krivoshei@gmail.com>
Subject: Re: Directory Operations
Date: Tue, 4 Nov 2008 05:52:00 -0800 (PST)
Date: 2008-11-04T05:52:00-08:00	[thread overview]
Message-ID: <153a9dfc-96d4-4e7d-a54e-14f8f4d49c09@b38g2000prf.googlegroups.com> (raw)
In-Reply-To: 91990db2-68b4-4710-ba9b-b3a9d8375cad@e38g2000prn.googlegroups.com

Now the problem not seems to be in string representaion.
The example code is below.
Calling the function "Test_DLL" from fad.dll without using
"Ada.Directories" works perfectly.
However, uncommenting the line <Path: String :=
Ada.Directories.Current_Directory;> gives non working variant.
Try to call the same function from the DLL now finishes by the DLL
crash.
The line <Path: String := Ada.Directories.Current_Directory;> do
nothing usefull in the example, but it must not invite the DLL to
crash.

Can somebody explain, what is wrong?
May be some compiler, builder, linker switches can be a cause of such
behaviour?
I am using the GNAT compiler from GPS+GNAT(MinGW) complect under
Windows XP.
The DLL was tested using the NI LabVIEW and "ExecDLL (http://
www.codeproject.com/KB/DLL/Execute_DLL_Function.aspx)"

Thanks for everybody for advices.

---------------------------
-- fad.ads ----------------
---------------------------
with Ada.Directories;

package FAD is

   function Pwd return String;   -- I don't use it now
   pragma Export(C, Pwd, "pwd");
   function Pwd return String renames
Ada.Directories.Current_Directory;

   function Test_DLL(A, B: in Integer) return Integer;
   pragma Export(C, Test_DLL, "Test_DLL");

end FAD;

---------------------------
-- fad.adb ----------------
---------------------------
package body FAD is

   function Test_DLL(A, B: in Integer) return Integer is
-- ==>  Path: String := Ada.Directories.Current_Directory;
   begin
      return A*B;
   end Test_DLL;

end FAD;



      parent reply	other threads:[~2008-11-04 13:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]
replies disabled

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