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.1 required=5.0 tests=BAYES_00, PP_MIME_FAKE_ASCII_TEXT,XPRIO autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII X-Google-Thread: 103376,8141f2ef049fcd7e,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-10-11 04:29:24 PST Path: archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!news.tele.dk!small.news.tele.dk!194.213.69.151!news.algonet.se!algonet!news-stob.telia.net!news-sto.telia.net!194.22.194.4.MISMATCH!masternews.telia.net.!newsc.telia.net.POSTED!not-for-mail From: "Peter Hend�n" Newsgroups: comp.lang.ada Subject: Help with GNAT, WinNT, StdCall, dll, exported names X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Message-ID: <%lfx7.6$_o6.503@newsc.telia.net> Date: Thu, 11 Oct 2001 11:26:51 GMT NNTP-Posting-Host: 213.67.175.183 X-Complaints-To: abuse@telia.com X-Trace: newsc.telia.net 1002799611 213.67.175.183 (Thu, 11 Oct 2001 13:26:51 CEST) NNTP-Posting-Date: Thu, 11 Oct 2001 13:26:51 CEST Organization: Telia Internet Xref: archiver1.google.com comp.lang.ada:14238 Date: 2001-10-11T11:26:51+00:00 List-Id: I'm using gnat 3.13p, trying to build a dll that exports functions that are to be called by a windows service. The problem is that the functions are declared in the .h file as BOOL WINAPI Foobar(LPFUNNY_STRUCT fum); Now I have defined an Ada function for this, and it works fine when I export it as pragma Export(C, Foobar, "Foobar");. Of course this will be called exactly once, because it is the wrong calling convention, and after its return the stack is fubar. When I try to declare it StdCall instead of C, I am not able to link it. Whatever I put in the .DEF file it comes out wrong. I get from the last gnatlink step in gnatdll: mydll.exp(.edata+0x34):fake: undefined reference to `Foobar' I have tried everything in the gnat user's guide, searched this groups archive and generally banged my head against the wall in appropriate - and perhaps not so appropriate - ways. Please help! /Peter H. -- Peter Hend�n http://www.algonet.se/~phenden ICQ: 14672398 Teknisk Dokumentation AB http://www.tdab.com