jaenster Posted April 15, 2008 Posted April 15, 2008 I need help with this function. It worked always very well. I never worked with dllcall but now i got an error, Please help me Func _SocketToIP($SHOCKET) Local $sockaddr = DllStructCreate("short;ushort;uint;char[8]") Local $aRet = DllCall("Ws2_32.dll", "int", "getpeername", "int", $SHOCKET, "ptr", DllStructGetPtr($sockaddr), "int_ptr", DllStructGetSize($sockaddr)) If Not @error And $aRet[0] = 0 Then $aRet = DllCall("Ws2_32.dll", "str", "inet_ntoa", "int", DllStructGetData($sockaddr, 3)) If Not @error Then $aRet = $aRet[0] Else $aRet = 0 EndIf $sockaddr = 0 Return $aRet EndFunc ;==>_SocketToIP Btw, This is the error >Running:(3.2.10.0):C:\Program Files\AutoIt3\autoit3.exe "D:\dev\ai\webserver\Webserver.au3" D:\dev\ai\webserver\Webserver.au3 (101) : ==> "long_ptr", "int_ptr" and "short_ptr" DllCall() types have been deprecated. Use "long*", "int*" and "short*" instead.: Local $aRet = DllCall("Ws2_32.dll", "int", "getpeername", "int", $SHOCKET, "ptr", DllStructGetPtr($sockaddr), "int_ptr", DllStructGetSize($sockaddr)) ->11:09:35 AutoIT3.exe ended.rc:1 -jaenster
AdmiralAlkex Posted April 15, 2008 Posted April 15, 2008 (edited) Maybe you should do as the error says and replace "int_ptr" with "int*" Edited April 15, 2008 by AdmiralAlkex .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface
LarryDalooza Posted April 15, 2008 Posted April 15, 2008 Also... you need TCPStartup() before it works. Lar. AutoIt has helped make me wealthy
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