From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,f91205dad8b4d2db X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!postnews.google.com!b38g2000prf.googlegroups.com!not-for-mail From: AndreiK Newsgroups: comp.lang.ada Subject: Re: Directory Operations Date: Tue, 4 Nov 2008 05:52:00 -0800 (PST) Organization: http://groups.google.com Message-ID: <153a9dfc-96d4-4e7d-a54e-14f8f4d49c09@b38g2000prf.googlegroups.com> References: <91990db2-68b4-4710-ba9b-b3a9d8375cad@e38g2000prn.googlegroups.com> NNTP-Posting-Host: 193.40.240.135 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: posting.google.com 1225806720 7932 127.0.0.1 (4 Nov 2008 13:52:00 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 4 Nov 2008 13:52:00 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: b38g2000prf.googlegroups.com; posting-host=193.40.240.135; posting-account=kfQcmwoAAAAImQIpF8z0neulU3uSEwPV User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3,gzip(gfe),gzip(gfe) Xref: g2news2.google.com comp.lang.ada:8293 Date: 2008-11-04T05:52:00-08:00 List-Id: 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 gives non working variant. Try to call the same function from the DLL now finishes by the DLL crash. The line 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;