Jump to content

dllcall


jtwspoon
 Share

Recommended Posts

Do something like this:

locaL $get=10
Local $ret=DllCall("gslink.dll","none","gsupdate","int*",$get)
$get=$ret[1]
MsgBox(0,"",$get)

use stdcall

procedure gsupdate(var y: integer);  stdcall;

Saludos

Link to comment
Share on other sites

Ok, I know I can do it that way, but  I want to eventually do something more substantial --- namely  altering the elements of an array passed to the dll.  Are the changed values always going to have to be accessed as elements of the $ret array, as in the example you posted, and NOT from the original array as passed to the dll?

Link to comment
Share on other sites

Link to comment
Share on other sites

Yes, but still have to get the changed varaibles from $ret array?  Also, I notice that if I try to write to a file in the dll, then return back to autoit is corrupted so that autoit fails to continue, and morevover nothing ever gets written to the file, so I am unsure exactly what is getting corrupted and how.

Link to comment
Share on other sites

I mean something like this:

local $t=dllstructurecreate("long mylong")

dllcall("midll","none","mifuntion","ptr",dllstructuregetptr($t))

msgbox(0,"",$t.mylong)

Saludos
Link to comment
Share on other sites

Link to comment
Share on other sites

Now I have my dll working correctly as called from autoit via DllCall, however if I attempt to write to a file from within my dll,  there is no  return to autoit from my dll.  What could be causing this?  I am sure there is no error in the code which writes to the file, and no path not found problem or anything of that sort. My Dll is written in Free Pascal, and I am running under Windows 7.

Link to comment
Share on other sites

Also,  if I run my dll as a stand-alone program, calculations differ from when I  run it as a dll.  In particular, some elements of a multidimensional array are not computed at all when run as a dll, while they are computed when run as a stand-alone program.  I tend to infer that  code within the dll gets corrupted when run as a dll from autoit.  Not sure what further tests I can try to resolve this problem.

Link to comment
Share on other sites

Show us your code you have so far.

Programming today is a race between software engineers striving to
build bigger and better idiot-proof programs, and the Universe
trying to produce bigger and better idiots.
So far, the Universe is winning.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...