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 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 05:52:36 PST Path: archiver1.google.com!news2.google.com!fu-berlin.de!uni-berlin.de!tar-meneldur.cbb-automation.DE!not-for-mail From: Dmitry A. Kazakov Newsgroups: comp.lang.ada Subject: Re: Minimal pragma Export (StdCall... example? Date: Thu, 11 Mar 2004 15:03:15 +0100 Message-ID: References: NNTP-Posting-Host: tar-meneldur.cbb-automation.de (212.79.194.119) Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: news.uni-berlin.de 1079013154 66709266 I 212.79.194.119 ([77047]) X-Newsreader: Forte Agent 1.8/32.548 Xref: archiver1.google.com comp.lang.ada:6233 Date: 2004-03-11T15:03:15+01:00 List-Id: 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"]); -- Regards, Dmitry Kazakov www.dmitry-kazakov.de