473,406 Members | 2,816 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Accessing a .dll function via Win32::API

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:

Expand|Select|Wrap|Line Numbers
  1. # header stuff
  2. use feature ':5.10';
  3. binmode(STDOUT, ":encoding(cp850)");
  4. use Win32::API;
  5. # header end
  6.  
  7.  
  8.  
  9. # *******************************
  10. # -> THE MAGIC SHOULD START HERE:
  11. # *******************************
  12.  
  13. # invoke the function 'DOTP' within the Carbondioxide.dll
  14. # with 2 arguments, Double precision 'DD' and a Double precision return 'D'
  15.  
  16. # (shall calculate the density of co2 at given temperature in Kelvin and pressure in MPa)
  17.  
  18. # !!! ARGUMENTS shall be handed over BY REFERENCE whereas
  19. # RETURN values of the function are given back BY VALUE
  20.  
  21. $function=Win32::API->new('CARBONDIOXIDE','DOTP','DD','D');
  22.  
  23. $T=300;
  24. $P=6;
$return = $function->Call(\$T,\$P); # CRASHES here for unknown reason

say $return."\n";
May 8 '12 #1
1 2454

Sign in to post your reply or Sign up for a free account.

Similar topics

16
by: micha | last post by:
i have the following code: function some_function($argument) { validate_arg(); //more code } function validate_arg() {
5
by: Gary Richardson | last post by:
I'm trying to use win32api.SetCursorPos() to position the cursor in a Tkinter canvas window. I.e.: from Tkinter import * import win32api root = Tk() canvas = Canvas(root, width=400,...
2
by: Sergey Romanov | last post by:
I have two window app. I have Tree in main window and in code of that window I have function BuildTree(); This function start with tree.Clear(); So it completely rebuild tree. When I open other...
3
by: johkar | last post by:
My child window has this script. "temp" is simply the value of the select list which I am passing onchange. I get a permission denied error in IE when executing selectOption. function...
4
by: Tony Lownds | last post by:
(Note: PEPs in the 3xxx number range are intended for Python 3000) PEP: 3107 Title: Function Annotations Version: $Revision: 53169 $ Last-Modified: $Date: 2006-12-27 20:59:16 -0800 (Wed, 27 Dec...
5
by: anirbid.banerjee | last post by:
Hi List, This question can be categorised under "C programming in Linux", but as I didnt find any group of that sort, I post it here. I have a small program to print the stack trace of a...
4
by: Tobiah | last post by:
Is there a way to call function in an imported module having only the name? func_name = 'doit' real_func = foo.some_magic(func_name) #Now call it real_func(args)
2
by: Licheng Fang | last post by:
On Apr 14 2003, 10:30 pm, Alex Martelli <al...@aleax.itwrote: Sorry to dig up this old thread, but I would like to know what's the rationale is. Why can't a nested function rebind a variable of...
0
by: mantoast | last post by:
I am working on getting access to Bluetooth devices. Important information: OS: Win XP Python2.5 Using Ctypes I can access the .dlls needed in the bluetooth stack, but I cannot get access to the...
1
by: john20 | last post by:
Hi All, I am having a problem with accesing function in the page. i have a page say user.aspx in the page load method i am calling function to validate the user. it works fine when single...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.