Sign in to follow this  
Followers 0
capo

DllStructGetData help

2 posts in this topic

#1 ·  Posted (edited)

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

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  
Followers 0