Hi,
for 64 bit, 32 bit, 32 bit_cdecl and 32bit_ctdcall.
I noticed that in the 32bit folder, Coolprop.dll is missing.
My computer is 64bit, Windows 10.
For the 64 bit trial, both give the error that PropsSI@32 can not be located in the dll, if I execute the exe files from the command prompt. For all the 32bit versions, I get the message that the application was unable to start correctly. I omitted the lines {$APPTYPE CONSOLE} and {$R *.res}. I believe the res file is only needed when using a form?
Any idea what goes wrong here?
As a simple program
program project3;
CONST
COOL_PROP = 'CoolProp.dll';
function PropsSI(Output: PAnsichar; Name1: PAnsichar; Prop1: Double; Name2: PAnsichar; Prop2: Double; FluidName: PAnsichar): Double; stdcall; external COOL_PROP name '_PropsSI@32';
var
p: Double;
begin
p := PropsSI('P', 'T', 300, 'D', 1, 'Propane');
end.
As an application:
unit Unit1;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls, Windows;
CONST
COOL_PROP = 'CoolProp.dll';
type
{ TForm1 }
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
public
end;
function PropsSI(Output: PAnsichar; Name1: PAnsichar; Prop1: Double; Name2: PAnsichar; Prop2: Double; FluidName: PAnsichar): Double; stdcall; external COOL_PROP name '_PropsSI@32';
var
Form1: TForm1;
implementation
{$R *.lfm}
{ TForm1 }
procedure TForm1.Button1Click(Sender: TObject);
var
p: Double;
begin
p := PropsSI('P', 'T', 300, 'D', 1, 'Propane');
end;
end.
Both give the error:
