Jump to content

DllStructGetData help


capo
 Share

Recommended Posts

I have a dll and a function is like:

int function(char *st,ulong FR,tstruct *cstruct,int att,int size,char *text);

how would i call this in autoit?

i tried:

Dim $cstruct
$cstruct = DllStructCreate("char error[255];int flag")

$a = function(1,2,3,4,5)
msgbox(0,'',DllStructGetData($cstruct,"error",1))


Func function($p1,$p2,$p3,$p4,$p5)
    $dll = DllCall("DLL.dll","int","function","str",$p1,"ulong",$p2,"ptr",DllStructGetPtr($cstruct),"int",$p3,"int",$p4,"str",$p5)
    return $dll[0]
EndFunc

Is there anything wrong with that code? am i calling the dll correctly ?

Edited by capo
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...