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,start X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!postnews.google.com!e38g2000prn.googlegroups.com!not-for-mail From: andrei.krivoshei@gmail.com Newsgroups: comp.lang.ada Subject: Directory Operations Date: Mon, 3 Nov 2008 08:27:36 -0800 (PST) Organization: http://groups.google.com Message-ID: <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 1225729656 8715 127.0.0.1 (3 Nov 2008 16:27:36 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Mon, 3 Nov 2008 16:27:36 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: e38g2000prn.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: g2news1.google.com comp.lang.ada:2559 Date: 2008-11-03T08:27:36-08:00 List-Id: 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;