Jump to content
Sign in to follow this  
jlf

DllCall in x64 with 'double' and 'string' in parameters list

Recommended Posts

jlf

Hi

When I use DllCall function to call a 64bits dll, I encounter a strange behavior. If the dll has to receive a string in first parameter and a 'double' in second parameter, this 2nd one is NOT received by the called function.

I have done some tests, and :

  • x64 + string + double ==> double NOT received
  • x64 + double ==> double succesfully received
  • x86 + string + double ==> double succesfully received
  • x86 + double ==> double succesfully received
The test dll is compiled with MinGW32 (for x86 dll version) / MinGW64 (for x64 version).

My objective is to use a DLL that is already compiled in x64 and having string+double+others parameters (in this order).

Attached files are a simple example of what is ok/ko. Here's the result of what I get when running the test_double.au3 script:

[font=courier new,courier,monospace]Result
call_float__________ => MyFloatValue_ = 0.005000
call_float_filename_ => MyFloatValue_ = 0.005000 - filename = test
call_double_________ => MyDoubleValue = 0.005000
call_double_filename => MyDoubleValue = 0.000000 - filename = test
call_double_filename => MyDoubleValue = 0.000000 - filename = test[/font]

As you can see, both last result report null value...

Files :

  • test_call.c : source code for the simple dll

  • makefile (rename it to .bat)

  • test_double.au3 : script code to call dll & execute

  • test_double_dll.7z : compiled DLL (if you cannot recompile C to DLL)
Thanks in advance for your help

Best Regards

_makefile_DLL_MinGW.txt

test_call.c

test_double.au3

test_double_dll.7z

Edited by jlf

Share this post


Link to post
Share on other sites
trancexx

This was a bug. I have posted about this recently.

To get it right you should go with beta AutoIt. Sorry for the inconvenience.


♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites
jchd

@jlf

Please post a link pointing here or a short explanation as a followup to your thread in the frenchy forum.


This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×