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-13 17:01:38 PST Path: archiver1.google.com!postnews2.google.com!not-for-mail From: happysegfault@yahoo.com (Happy Segfault) Newsgroups: comp.lang.ada Subject: Re: Minimal pragma Export (StdCall... example? Date: 13 Mar 2004 17:01:37 -0800 Organization: http://groups.google.com Message-ID: References: <2de350pqsadlrvvgkrpc7261k31l5ejuap@4ax.com> NNTP-Posting-Host: 68.184.214.99 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1079226097 19984 127.0.0.1 (14 Mar 2004 01:01:37 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sun, 14 Mar 2004 01:01:37 +0000 (UTC) Xref: archiver1.google.com comp.lang.ada:6312 Date: 2004-03-13T17:01:37-08:00 List-Id: Dmitry A. Kazakov wrote in message news:<2de350pqsadlrvvgkrpc7261k31l5ejuap@4ax.com>... > > The pragma Export gives you an opportunity to explicitly specify the > name used in the DLL. So you can name your Pop_A_Window as > "pop_a_window@0". You can also move it to Visual Basic side, where you > can explicitly specify the link name: > > Declare Function Pop_A_Window Lib "my_Ada.dll" Alias "_pop_a_window" > (...) As Long > > Probably you want to automate it and omit specifying any link name > altogether. I doubt it that is possible. > > Though you can always buy GNAT Pro and try to convince ACT (GNAT > vendor) to implement > > pragma Export/Import (VisualBasic, ...); I took a look at glBegin() as an example Stdcall function. It appears in Windows' OPENGL32.DLL as glBegin, not _glBegin or _glBegin@4, according to objdump -p. It is pramga-Import'ed in win32-gl.ads in my GNAT distribution with the command pragma Import (Stdcall, glBegin, "glBegin"); If I take a look at the symbol table for the GNAT-supplied import library libopengl32.a, using objdump -t, I find it listed as _glBegin@4 and not also as glBegin or glBegin@4. If I could replicate this with my own combination of a pragma Export (Stdcall, ... and the right gnatmake, gnatdll (or directly gnatlink, gnatbind, dlltool) options, I think I'd have it. Unfortunately, I've got pop_a_window@0 in my DLL (bad) and _pop_a_window@0 in my import library (good) at this point, which messes up the import into Visual Basic. If I leave off the @0 in the def file, I can get pop_a_window in the DLL (good) but then have _pop_a_window in the import library (bad). Any ideas, anyone? Thanks for the reply! After checking out your homepage, I'm pretty sure you're ten times the programmer I am! John