comp.lang.ada
 help / color / mirror / Atom feed
* Help with GNAT, WinNT, StdCall, dll, exported names
@ 2001-10-11 11:26 Peter Hend�n
  2001-10-11 11:44 ` David Botton
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Peter Hend�n @ 2001-10-11 11:26 UTC (permalink / raw)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1040 bytes --]

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





^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2001-10-12  9:48 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-10-11 11:26 Help with GNAT, WinNT, StdCall, dll, exported names Peter Hend�n
2001-10-11 11:44 ` David Botton
2001-10-11 16:06   ` Peter Hend�n
2001-10-11 19:03     ` David Botton
2001-10-11 13:28 ` Stephen Leake
2001-10-11 16:23   ` Peter Hend�n
2001-10-11 19:24   ` David Botton
2001-10-11 23:28     ` Peter Hend�n
2001-10-11 23:46       ` David Botton
2001-10-12  9:48         ` Peter Hend�n
2001-10-11 17:59 ` Sergey Koshcheyev

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