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-12 04:51:00 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: happysegfault@yahoo.com (Happy Segfault) Newsgroups: comp.lang.ada Subject: Re: Minimal pragma Export (StdCall... example? Date: 12 Mar 2004 04:50:59 -0800 Organization: http://groups.google.com Message-ID: References: NNTP-Posting-Host: 68.184.214.99 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1079095859 30352 127.0.0.1 (12 Mar 2004 12:50:59 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 12 Mar 2004 12:50:59 +0000 (UTC) Xref: archiver1.google.com comp.lang.ada:6263 Date: 2004-03-12T04:50:59-08:00 List-Id: Dmitry A. Kazakov wrote in message news:... > On 11 Mar 2004 05:31:24 -0800, happysegfault@yahoo.com (Happy > Segfault) wrote: > > >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? > > Why do you use C convention? It should be rather > > pragma Export (StdCall, Local_Name [, "External_Name"]); That's what I'm trying to do, and I'm having the problems above. John