darkjohn20 Posted October 2, 2010 Share Posted October 2, 2010 (edited) The problem was that I was using the wrong command. The correct one returns a string. The original question didn't make any sense and was too open ended, so it has been removed. Please don't bump! Edited October 2, 2010 by darkjohn20 Link to comment Share on other sites More sharing options...
JohnOne Posted October 2, 2010 Share Posted October 2, 2010 (edited) Try $aReturn[0] DllCall returns an array Edited October 2, 2010 by JohnOne AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
darkjohn20 Posted October 2, 2010 Author Share Posted October 2, 2010 When it doesn't create an array $aReturn gives the value 0. Otherwise it won't give any value. Link to comment Share on other sites More sharing options...
JohnOne Posted October 2, 2010 Share Posted October 2, 2010 So you tried it ? AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
darkjohn20 Posted October 2, 2010 Author Share Posted October 2, 2010 (edited) Yes, it throws an error and returns 0. It's named $aReturn for a reason . I also have the $aReturn[0] later in my code, which is why the error is thrown, because [0] doesn't exist. Edit: I believe that it's not working because of a problem with the return type. My other parameters are correct and I'm accessing it correctly later in the script (as an array, that is). Edited October 2, 2010 by darkjohn20 Link to comment Share on other sites More sharing options...
JohnOne Posted October 2, 2010 Share Posted October 2, 2010 Show your code that works. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
darkjohn20 Posted October 2, 2010 Author Share Posted October 2, 2010 (edited) Show your code that works. My code doesn't work. I'm trying to figure out why. All I was stating before was that I have everything set up correctly, it's just the DLL Call that isn't working out. The two parameters have the correct values, and the function name is right. I'm accessing it correctly later in the script (as an array, that is).Meaning that I'm using $aReturn[0] later in my code. The problem is that the DLL call is failing. My full function is: Func _GetClientAddressTCP($iInstance, $iClientID) Local $aReturn = DllCall($hDLL, "str:cdecl", "GetClientAddressTCP", "ulong_ptr", $iInstance, "ulong_ptr", $iClientID) Return $aReturn[0] EndFunc And yes, the DLL is defined AND opened. Edited October 2, 2010 by darkjohn20 Link to comment Share on other sites More sharing options...
smashly Posted October 2, 2010 Share Posted October 2, 2010 (edited) Hi, what DLL is it? Try adding error check after the DllCall before even trying to return $aReturn[0] When it's failing the call is it AutoIt DllCall failing? eg: @error 1, 2 , 3, 4 Or maybe your meaning that AutoIt DllCall doesn't fail but the call is failing from the dll itself. Without knowing the proper info about the dll and the data and method of the call then it makes it hard to say where and why your call is failing. Your posting little info and wanting people to fill in the big picture with guesses and assumptions. Edit, My guess is that your using a dll from MikeNet aka DarkNet? Edited October 2, 2010 by smashly Link to comment Share on other sites More sharing options...
darkjohn20 Posted October 2, 2010 Author Share Posted October 2, 2010 Well, the error code is 3, so I guess the function doesn't exist. I'll review the source code to see if it's under a different name. I also realize that I'm leaving a big gap. At first I figured that NetAddress was the problem, and I also figured that that was a well known Class or whatever you want to call it. About 5 minutes after I posted I realized that it wasn't, which would be confusing to anybody reading the topic. I'll look through the code to see if I can locate the problem. I'll come back when I figure out what is going on. Thanks for your time and sorry for the confusion. Link to comment Share on other sites More sharing options...
darkjohn20 Posted October 2, 2010 Author Share Posted October 2, 2010 (edited) Hi, what DLL is it? Try adding error check after the DllCall before even trying to return $aReturn[0] When it's failing the call is it AutoIt DllCall failing? eg: @error 1, 2 , 3, 4 Or maybe your meaning that AutoIt DllCall doesn't fail but the call is failing from the dll itself. Without knowing the proper info about the dll and the data and method of the call then it makes it hard to say where and why your call is failing. Your posting little info and wanting people to fill in the big picture with guesses and assumptions. Edit, My guess is that your using a dll from MikeNet aka DarkNet? Yes, I am. Since Mike is a friend of mine I'm asking him about the situation. This is the function I'm trying to use, and my guess is it isn't in the "Normal DLL", or it's under an extended name. Edit: AHH. It appears that there is also the command GetClientIPTCP. That's exactly what I need. Problem is most likely solved, because I seem to remember that command from version 1. I feel kind of stupid now. That command was there the whole time, but I didn't find it somehow. Edited October 2, 2010 by darkjohn20 Link to comment Share on other sites More sharing options...
Richard Robertson Posted October 2, 2010 Share Posted October 2, 2010 You can't call a constructor with DllCall. It doesn't work that way. Link to comment Share on other sites More sharing options...
darkjohn20 Posted October 2, 2010 Author Share Posted October 2, 2010 You can't call a constructor with DllCall. It doesn't work that way.Thanks for informing me. I honestly don't have any idea what a constructor is, I was just wondering if it would be of any help. I found the right command so the original question(s) don't need to be answered. Link to comment Share on other sites More sharing options...
Richard Robertson Posted October 2, 2010 Share Posted October 2, 2010 What you have is an object. Objects are created using special functions called constructors. Objects aren't impossible to use in DllCall, but they are very difficult and I'm not entirely sure how you can use them. Link to comment Share on other sites More sharing options...
darkjohn20 Posted October 2, 2010 Author Share Posted October 2, 2010 Alright, thanks. After talking with the creator/writer/whatever you want to call him, I have confirmed that GetClientAddressTCP can only be used in C++, and that GetClientIPTCP is what I was looking for. 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