sunless Posted April 21, 2007 Posted April 21, 2007 i want use a delphi fucn Function GetVolume(strVolumeMountPoint, strVolumeName:String; intBufferLength:Longword):integer; stdcall; external 'DiskVolume.dll'; but i convert it au3 ,it not work Func _GetVolume($diskname) $str = "char[128]" $a = DllStructCreate($str) $rc= DllCall("DiskVolume.dll","ubyte","GetVolume","str",$diskname,"ptr",DllStructGetPtr ($a)) $dd = DllStructGetData($a,1) Return $dd EndFunc
PaulIA Posted April 21, 2007 Posted April 21, 2007 i want use a delphi fucn Function GetVolume(strVolumeMountPoint, strVolumeName:String; intBufferLength:Longword):integer; stdcall; external 'DiskVolume.dll'; but i convert it au3 ,it not work Func _GetVolume($diskname) $str = "char[128]" $a = DllStructCreate($str) $rc= DllCall("DiskVolume.dll","ubyte","GetVolume","str",$diskname,"ptr",DllStructGetPtr ($a)) $dd = DllStructGetData($a,1) Return $dd EndFuncYou're not providing the correct parameters in DllCall. The function requires 3 parameters and you're only passing 2. I have no way of testing this because I could not find DiskVolume.dll anywhere in any of the Delphi environments that I have, but if you posted the prototype correctly, the function should look like this: Func GetVolume($sMountPoint) Local $aResult $aResult = DllCall("DiskVolume.dll", "int", "GetVolume", "str", $sMountPoint, "str", "", "int", 128) Return SetError($aResult[0], 0, $aResult[2]) EndFunc Auto3Lib: A library of over 1200 functions for AutoIt
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now