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 22:41:53 PST Path: archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!nnx.oleane.net!oleane!teaser.fr!enst.fr!melchior!cuivre.fr.eu.org!melchior.frmug.org!not-for-mail From: Per Sandberg Newsgroups: comp.lang.ada Subject: Re: function from dll Date: Fri, 23 Jan 2004 07:05:14 +0100 Organization: Cuivre, Argent, Or Message-ID: References: Reply-To: per.sandberg@bredband.net NNTP-Posting-Host: lovelace.ada-france.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Trace: melchior.cuivre.fr.eu.org 1074837936 49317 80.67.180.195 (23 Jan 2004 06:05:36 GMT) X-Complaints-To: usenet@melchior.cuivre.fr.eu.org NNTP-Posting-Date: Fri, 23 Jan 2004 06:05:36 +0000 (UTC) To: comp.lang.ada@ada-france.org Return-Path: User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.6b) Gecko/20031208 X-Accept-Language: en-us, en, sv In-Reply-To: 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:4692 Date: 2004-01-23T07:05:14+01:00 Why don do an lib file that contains all symbols in the dll and then link the library and avoid messing around with liad libraray and such. Unless you requere dynamic loading ofd the dll in runtime. sample code external C{ // to avoid C++ name mangling. void sth(){}; } ,sth,"sth"); pragma Linker_Options("-llibname"); -- GNAT specific. #if GNAT then How to create a lib-file copy the libname.lib to liblibname.a then gnatmake -L #elseif ObjectAda then In project properties add libname.lib to linker arguments Add the directory wher libname.lib resides in the "Linker only" search list. #end if; /Per Sandberg Szymon Guz wrote: > 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; > > > now I want to run in the ada function body the function from dll... well > how to use the Win32.Windef.FARPROC handle ? > > Szymon Guz > > > _______________________________________________ > comp.lang.ada mailing list > comp.lang.ada@ada-france.org > http://www.ada-france.org/mailman/listinfo/comp.lang.ada >