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 05:02:29 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 05:02:29 -0800 Organization: http://groups.google.com Message-ID: References: <40507f55$1@news.wineasy.se> NNTP-Posting-Host: 68.184.214.99 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1079096549 31125 127.0.0.1 (12 Mar 2004 13:02:29 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 12 Mar 2004 13:02:29 +0000 (UTC) Xref: archiver1.google.com comp.lang.ada:6266 Date: 2004-03-12T05:02:29-08:00 List-Id: "Frank" wrote in message news:<40507f55$1@news.wineasy.se>... > 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 I've found that Visual Basic can successfully call functions in the DLL. By using objdump to check the symbol table, the (I think) properly decorated function name is there: _pop_a_window@0. A call to "pop_a_window" in VB works just fine. I don't think the DLL itself is a problem---it has the right function names. There are two other parts, and neither one seems to do what I expect. The link library that gnatdll produces has only _pop_a_window (leaves off the @0), and the pragma Import (Stdcall, Pop_A_Window, "pop_a_window") in the test app causes the linker to look for pop_a_window@0 in the link library. Both should be _pop_a_window@0 if they're really StdCall, right? I've tried several combinations of linker options on gnatdll, but I wasn't able to get it to export _pop_a_window@0 in the link library. I was hoping someone had a minimal working example of Stdcall export and import (especially the makefile). Anybody? Thanks for the tip! John