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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,529481ac2d77d9f6 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!proxad.net!proxad.net!newsfeed.arcor.de!newsspool2.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Translating a VB dll header to Ada Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <1176320910.543255.74730@b75g2000hsg.googlegroups.com> Date: Thu, 12 Apr 2007 10:06:44 +0200 Message-ID: NNTP-Posting-Date: 12 Apr 2007 10:06:45 CEST NNTP-Posting-Host: 46bc12bf.newsspool1.arcor-online.net X-Trace: DXC=QkPBK@HO2TB2:OR3:3gaE@ic==]BZ:afN4Fo<]lROoRAFl8W>\BH3YBkgBD3FQDcaJA5A X-Complaints-To: usenet-abuse@arcor.de Xref: g2news1.google.com comp.lang.ada:14924 Date: 2007-04-12T10:06:45+02:00 List-Id: On 11 Apr 2007 12:48:30 -0700, vienapl@hotmail.com wrote: > I'm a really unexperienced programmer who trying to call a dll from > Ada code. It compiles properly, but after some function calls I get > the following error: raised PROGRAM_ERROR : > EXCEPTION_ACCESS_VIOLATION. > > The VB code is the following: I am not an expert in VB, but for what it is worth 1. Microsoft changes VB permanently, you should really mention the version number of the Beast. (:-)) 2. The VBs I dealt with didn't used C convention. In your sources I see pragma Import (C, ...); This means a C convention (cdecl in Windows terms), but it should be stdcall instead: pragma Import (stdcall, ...); -- If you are using GNAT 3. Passing strings from/to VB is a mess. I don't remember the details, sorry. Maybe others could comment on that. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de