comp.lang.ada
 help / color / mirror / Atom feed
From: vienapl@hotmail.com
Subject: Re: Translating a VB dll header to Ada
Date: 12 Apr 2007 07:17:46 -0700
Date: 2007-04-12T07:17:46-07:00	[thread overview]
Message-ID: <1176387466.525266.257670@n59g2000hsh.googlegroups.com> (raw)
In-Reply-To: <fdwh3w7tsg51$.cg9je6e42t2n.dlg@40tude.net>

Although the header I'm trying to translate is in VB6, I guess that
the dll itself wasn't written with VB, but C++ instead. I actually
also have availible the C header for it (http://pastebin.ca/436394),
but I thought that the VB one was easier to understand and translate
for somoene who only used a bit of Ada. In fact, if I try to build the
test executable using Stdcall, I get compilation errors (undefined
references to the functions). So I guess the C calling conention is
right on this one.

On Apr 12, 10:06 am, "Dmitry A. Kazakov" <mail...@dmitry-kazakov.de>
wrote:
> On 11 Apr 2007 12:48:30 -0700, vien...@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. Kazakovhttp://www.dmitry-kazakov.de





  reply	other threads:[~2007-04-12 14:17 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-11 19:48 Translating a VB dll header to Ada vienapl
2007-04-12  8:06 ` Dmitry A. Kazakov
2007-04-12 14:17   ` vienapl [this message]
2007-04-12 17:16     ` Dmitry A. Kazakov
2007-04-13 15:25       ` vienapl
2007-04-13 16:55         ` Dmitry A. Kazakov
2007-04-14  1:05           ` vienapl
2007-04-14  7:17             ` Dmitry A. Kazakov
2007-04-14 12:16               ` vienapl
2007-04-14 14:01                 ` Philippe Bertin
2007-04-14 15:30                 ` Dmitry A. Kazakov
2007-04-14 21:37                   ` vienapl
2007-04-15 14:03                     ` vienapl
2007-04-15 15:32                       ` Dmitry A. Kazakov
2007-04-18 18:47                       ` Tarjei T. Jensen
2007-04-12 11:34 ` gautier_niouzes
2007-04-12 14:24   ` vienapl
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox