Discussions related to Visual Prolog
User avatar
Tonton Luc
VIP Member
Posts: 204
Joined: 16 Oct 2001 23:01

Language stdcall

Unread post by Tonton Luc »

Hi,

Which is the good declaration in a VP 7.3 dLL please ?

Code: Select all

predicates     test1 : (string8,string8*,real) -> string8 Reponse procedure (i,i,i) language stdcall as "_test1@12".     test1 : (string8,string8*,real) -> string8 Reponse procedure (i,i,i) language stdcall as "_test1@16".     test1 : (string8,string8*,real) -> string8 Reponse procedure (i,i,i) language stdcall as "_test1@24".     test1 : (string8,string8*,real) -> string8 Reponse procedure (i,i,i) language stdcall as "_test1@32".
I don't remember how to calculate the value after @ : 12, 16, 24 or 32.
User avatar
Thomas Linder Puls
VIP Member
Posts: 1232
Joined: 28 Feb 2000 0:01

Unread post by Thomas Linder Puls »

You may have a look at Domains#Calling_Convention pay attention to what is written about apicall

The value after @ is the size that the arguments occupy on the call stack.

In this case right number is 16 because a string8 and lists are 4 bytes (a pointer) and the real 64 bit.

However, if only you intend to call this from Visual Prolog you don't need to follow the @ standard (or to use stdcall for that matter, and you can even call nondeterministic predicates).
Regards Thomas Linder Puls
PDC
User avatar
Tonton Luc
VIP Member
Posts: 204
Joined: 16 Oct 2001 23:01

Unread post by Tonton Luc »

Hi,

Exactly what I need.
Many thanks for your help.

This VP 7.3 dLL is calling from a VP 5.2 application => so I need to indicate this value.
User avatar
Tonton Luc
VIP Member
Posts: 204
Joined: 16 Oct 2001 23:01

Unread post by Tonton Luc »

Hi,

And what about integer ?
Only string and string8 needs value after @ ?
Does this following predicates is ok ?

Code: Select all

calculer_vr_multiple : (integer,integer,integer,integer,integer,integer_list) procedure (i,i,i,i,i,o) language stdcall as "_calculer_vr_multiple@".
User avatar
Thomas Linder Puls
VIP Member
Posts: 1232
Joined: 28 Feb 2000 0:01

Unread post by Thomas Linder Puls »

An integer (and unsigned and all subtypes of these) count 4.
Regards Thomas Linder Puls
PDC
User avatar
Tonton Luc
VIP Member
Posts: 204
Joined: 16 Oct 2001 23:01

Unread post by Tonton Luc »

ok, thanks.
User avatar
Tonton Luc
VIP Member
Posts: 204
Joined: 16 Oct 2001 23:01

Unread post by Tonton Luc »

Hi,

Sorry but I don't really understand your question. Do you mean how to link VP application with a VB dLL maybee ?
I never make VB08.
Post Reply