Re: call Pascal DLL functions from D

2017-10-25 Thread Basile B. via Digitalmars-d-learn
On Wednesday, 25 October 2017 at 10:47:56 UTC, Oleg B wrote: On Wednesday, 25 October 2017 at 04:30:12 UTC, Basile B. wrote: If I wrote `array[5..7] of ...` I get array that can be indexed by `5`, `6` and `7`, right? It means that array have 3 elements. If A=5, B=7 then length of array is

Re: call Pascal DLL functions from D

2017-10-25 Thread Oleg B via Digitalmars-d-learn
On Wednesday, 25 October 2017 at 03:36:54 UTC, Adam D. Ruppe wrote: I'd suggest just trying it and seeing if the functions return what you expect. Unfortunately they returns unexpected codes. Otherwise I wouldn't post question here. I go here then I have no idea to resolve problem.

Re: call Pascal DLL functions from D

2017-10-25 Thread Oleg B via Digitalmars-d-learn
On Wednesday, 25 October 2017 at 04:30:12 UTC, Basile B. wrote: On Wednesday, 25 October 2017 at 03:12:56 UTC, Oleg B wrote: 2. `array[A..B] of TFoo` is `TFoo[B-A+1]` (static array) No A-B. In Pascal the upper bound of a range (like here but i'm not sure this i called like that in the

Re: call Pascal DLL functions from D

2017-10-25 Thread Andre Pany via Digitalmars-d-learn
On Wednesday, 25 October 2017 at 03:12:56 UTC, Oleg B wrote: Hello. I have DLL written on Pascal and "headers" for use it (types and functions signatures definitions). How I can port "headers" to D? [...] Hi, this thread might be interesting for you, if you use Delphi

Re: call Pascal DLL functions from D

2017-10-24 Thread Basile B. via Digitalmars-d-learn
On Wednesday, 25 October 2017 at 03:12:56 UTC, Oleg B wrote: Hello. I have DLL written on Pascal and "headers" for use it (types and functions signatures definitions). How I can port "headers" to D? Calling convention is `stdcall` (`extern (Windows)` for D), arguments of some functions is

Re: call Pascal DLL functions from D

2017-10-24 Thread Adam D. Ruppe via Digitalmars-d-learn
On Wednesday, 25 October 2017 at 03:12:56 UTC, Oleg B wrote: Calling convention is `stdcall` (`extern (Windows)` for D), arguments of some functions is structs of structs and etc with static array fields: Fun fact, D has extern(Pascal): https://dlang.org/spec/attribute.html#linkage I

call Pascal DLL functions from D

2017-10-24 Thread Oleg B via Digitalmars-d-learn
Hello. I have DLL written on Pascal and "headers" for use it (types and functions signatures definitions). How I can port "headers" to D? Calling convention is `stdcall` (`extern (Windows)` for D), arguments of some functions is structs of structs and etc with static array fields: