Page 1 of 1

Language stdcall

Posted: 20 Apr 2016 20:55
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.

Posted: 21 Apr 2016 8:14
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).

Posted: 21 Apr 2016 9:32
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.

Posted: 21 Apr 2016 14:34
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@".

Posted: 21 Apr 2016 19:15
by Thomas Linder Puls
An integer (and unsigned and all subtypes of these) count 4.

Posted: 22 Apr 2016 7:10
by Tonton Luc
ok, thanks.

Posted: 24 Aug 2016 6:29
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.