JoshAssing Posted July 7, 2009 Share Posted July 7, 2009 I have a dll that a client wants me to write a small script for; so I thought it would be a good time to learn to use AutoIT with DLL's. $cDriveSN = DllCall(".\\GetDiskSerial.dll", "str", "GetSerialNumber", "int", 0, "str", "00000"); The 1st parameter is the drive # to fetch the serial # for. The 2nd parameter is just the "registration code" to "unlock" the dll. $cDriveSN is always empty. What have I done wrong? Thanks -josh Link to comment Share on other sites More sharing options...
weaponx Posted July 7, 2009 Share Posted July 7, 2009 (edited) $cDriveSN = DllCall(".\\GetDiskSerial.dll", "str", "GetSerialNumber", "int", 0, "str", "00000") Switch @ERROR Case 1 ConsoleWrite("Unable to use the DLL file" & @CRLF) Case 2 ConsoleWrite("Unknown return type", & @CRLF) Case 3 ConsoleWrite("Function not found in the DLL file" & @CRLF) EndSwitch If IsArray($cDriveSN) Then For $X = 0 to Ubound($cDriveSN)-1 ConsoleWrite("[" & $X & "]: " & $cDriveSN[$X] & @CRLF) Next Else ConsoleWrite("$cDriveSN is not an array" & @CRLF) EndIf Edited July 7, 2009 by weaponx Link to comment Share on other sites More sharing options...
JoshAssing Posted July 7, 2009 Author Share Posted July 7, 2009 Thanks for being gentle... I had just figured out my bonehead mistake -- I wasn't using the return value as an array "RTFM".. d'oh.. Thank you for your time. -josh Link to comment Share on other sites More sharing options...
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