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=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=unavailable autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,b70e24be869672e6 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2004-01-22 15:45:02 PST Path: archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.stueberl.de!teaser.fr!freenix!enst.fr!melchior!cuivre.fr.eu.org!melchior.frmug.org!not-for-mail From: Stephen Leake Newsgroups: comp.lang.ada Subject: Re: function from dll Date: 22 Jan 2004 18:43:07 -0500 Organization: Cuivre, Argent, Or Message-ID: References: NNTP-Posting-Host: lovelace.ada-france.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: melchior.cuivre.fr.eu.org 1074815002 99147 80.67.180.195 (22 Jan 2004 23:43:22 GMT) X-Complaints-To: usenet@melchior.cuivre.fr.eu.org NNTP-Posting-Date: Thu, 22 Jan 2004 23:43:22 +0000 (UTC) To: comp.lang.ada@ada-france.org Return-Path: In-Reply-To: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 X-Virus-Scanned: by amavisd-new-20030616-p5 (Debian) at ada-france.org X-BeenThere: comp.lang.ada@ada-france.org X-Mailman-Version: 2.1.3 Precedence: list List-Id: Gateway to the comp.lang.ada Usenet newsgroup List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Xref: archiver1.google.com comp.lang.ada:4686 Date: 2004-01-22T18:43:07-05:00 Szymon Guz writes: > Hi, > I've got maybe a trivial question but I still can't solve the problem: > > I've a dll written in C under Windows and I want to use specific > function from that in my Ada program. For loading the library I use > the WinApi function LoadLibrary and then I use the function > GetProcAddress to get the Win32.Windef.FARPROC handle to the function > that I need. I need to map the function from the dll in Ada to have > sth like that: > > > void sth(){} > > > > function sth() return Integer; > The Ada spec doesn't match the C spec; the C code does not return an int. > now I want to run in the ada function body the function from dll... > well how to use the Win32.Windef.FARPROC handle ? I've never actually done this, but you can probably define an access to procedure type, and do an unchecked conversion from System.Address to it. -- -- Stephe