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=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,3d1c21a87689d7bd X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2004-03-11 07:00:20 PST From: "Frank" Newsgroups: comp.lang.ada References: Subject: Re: Minimal pragma Export (StdCall... example? X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Original-NNTP-Posting-Host: 213.225.111.73 Message-ID: <40507f55$1@news.wineasy.se> X-Original-Trace: 11 Mar 2004 16:01:41 +0100, 213.225.111.73 X-Complaints-To: abuse@songnetworks.se NNTP-Posting-Host: news.wineasy.se X-Original-NNTP-Posting-Host: news.wineasy.se Date: 11 Mar 2004 16:00:10 +0100 X-Trace: wineasy!newsfeed.wineasy.se 1079017210 213.131.157.161 (11 Mar 2004 16:00:10 +0100) X-Complaints-To: abuse@songnetworks.se Path: archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!news.algonet.se!algonet!news.tele.dk!news.tele.dk!small.news.tele.dk!news-stoc.telia.net!news-stoa.telia.net!telia.net!wineasy!newsfeed.wineasy.se!news.wineasy.se!news.songnetworks.se!not-for-mail Xref: archiver1.google.com comp.lang.ada:6239 Date: 2004-03-11T16:00:10+01:00 List-Id: Hi! Some weeks ago I had difficulties with the same and managed to compile/link when I wrote the spec according to the following pattern, when I worked with a DLL written in Delphi Pascal : pragma Import (Stdcall, UpdateAll, External_Name => "UpdateAll", Link_Name => "_UpdateAll"); Unfortunately I havent tested the resulting executable since I do not have the necessary HW to do it, but it compiled. You could give it a try. Frank "Happy Segfault" wrote in message news:ed66a020.0403110531.19b21907@posting.google.com... > Hi all, > > I'm trying to write a DLL using GNAT 3.15p on Windows XP. The DLL needs to > export functions with the StdCall calling convention so that they can be > called from Visual Basic. Using samples/dll/ from the gwindows distribution > as a starting point, I haven't been successful in getting this to work. > > If I just change the occurrences of pragma Export (C... to pragma Export > (StdCall..., the Ada test driver program call_gw_dll.adb fails to link because > the link library libgw_in_a_dll.a exports "_pop_a_window" only, while the > linker wants "pop_a_window@0". Neither of these is the "_pop_a_window@0" I > would have expected to see for a StdCall function. > > Does anybody have a minimal set of code for a DLL, test program, and makefile > that demonstrates building a StdCall DLL using GNAT on Windows? > > Best regards, > John