Dear PERL friends,
would be very grateful for a solution:
I want to hand over arguments to a .dll function per reference but seem to fail somehow.
I have self-explaining (hopefully) comments in the code.
Thanks again,
Fabian
CODE:
$return = $function->Call(\$T,\$P ); # CRASHES here for unknown reason
say $return."\n";
would be very grateful for a solution:
I want to hand over arguments to a .dll function per reference but seem to fail somehow.
I have self-explaining (hopefully) comments in the code.
Thanks again,
Fabian
CODE:
Code:
# header stuff
use feature ':5.10';
binmode(STDOUT, ":encoding(cp850)");
use Win32::API;
# header end
# *******************************
# -> THE MAGIC SHOULD START HERE:
# *******************************
# invoke the function 'DOTP' within the Carbondioxide.dll
# with 2 arguments, Double precision 'DD' and a Double precision return 'D'
# (shall calculate the density of co2 at given temperature in Kelvin and pressure in MPa)
# !!! ARGUMENTS shall be handed over BY REFERENCE whereas
# RETURN values of the function are given back BY VALUE
$function=Win32::API->new('CARBONDIOXIDE','DOTP','DD','D');
$T=300;
$P=6;
say $return."\n";
Comment