Smed Posted April 19, 2005 Posted April 19, 2005 I finally have a real question. Since the "ptr" type exists for DllCall parameters, I'm guessing that it actually works. The help file shows only very basic examples of calls, a search on the forum produced a lot of "thats not quite what I'm looking for" results. I'm trying to call a DLL function that returns results in a buffer specified by the 3rd parameter. The results returned in the array by DllCall appears to be useless in this instance. Can someone point me towards an example on how to do this? Before someone says, "post your code", I'd like to point out that I'm not asking YOU to fix MY code, I'm asking for help on how to fix it myself. I'll post the code if and when I deem it usefull. 601DisengageEnd Program
Insolence Posted April 19, 2005 Posted April 19, 2005 I don't 100% understand what you're asking. If you posted an example it'd help me understand how to help you. I think ptr can sometimes be int, though. "I thoroughly disapprove of duels. If a man should challenge me, I would take him kindly and forgivingly by the hand and lead him to a quiet place and kill him." - Mark TwainPatient: "It hurts when I do $var_"Doctor: "Don't do $var_" - Lar.
Smed Posted April 19, 2005 Author Posted April 19, 2005 (edited) buffer sounds like a "str" to me... try it<{POST_SNAPBACK}>already tried that I just get the same string back.OK, here's the code, in its current incarnation.... sigh.$MAC = _GetMACFromIP ("192.168.1.1") MsgBox (0, "MAC Value", $MAC) ;MsgBox (0, "MAC Value", $MAC[0]&"-"&$MAC[1]&"-"&$MAC[2]&"-"&$MAC[3]&"-"&$MAC[4]) Func _GetMACFromIP ($sIP) $bMAC = "hhhhhh" $r = DllCall ("Ws2_32.dll", "int", "inet_addr", "str", $sIP) $iIP = $r[0] $r = DllCall ("iphlpapi.dll", "int", "SendARP", "int", $iIP, "int", 0, "str", $bMAC, "int", 6) Return $bMAC EndFuncI've tried arrays, strings, you name it, and I only get bs results.leave it to me to try something goofy for my first attempt at DllCall code. Edited April 19, 2005 by Smed 601DisengageEnd Program
Ejoc Posted April 19, 2005 Posted April 19, 2005 (edited) wont the mac be in $r[3] hmm that didnt work... Edited April 19, 2005 by Ejoc Start -> Programs -> AutoIt v3 -> AutoIt Help File -> Index -> (The Function you are asking about)----- Links -----DllStruct UDFsRSA Crypto UDFs
Smed Posted April 19, 2005 Author Posted April 19, 2005 wont the mac be in $r[3]hmm that didnt work...<{POST_SNAPBACK}>Yeh, I figured that you'd be interested in that function, but I had hoped to get it working before I started posting code. 601DisengageEnd Program
megahyperion Posted April 19, 2005 Posted April 19, 2005 I had a similar problem in this threadhttp://www.autoitscript.com/forum/index.php?showtopic=10538Never got it working
Ejoc Posted April 21, 2005 Posted April 21, 2005 Got it working: http://www.autoitscript.com/forum/index.php?showtopic=10710 Start -> Programs -> AutoIt v3 -> AutoIt Help File -> Index -> (The Function you are asking about)----- Links -----DllStruct UDFsRSA Crypto UDFs
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