Ejoc Posted May 9, 2005 Share Posted May 9, 2005 So when I was looking around at the UDFs I noticed 1 thing, that I thought I would mention. I know when you wrote them this wasn't possible but it is now, so you can shorten it up a bit, but your way is very readable and might be better for someone reading you code, here is an alternative: Instead of Local $ptr1 = "int", $ptr2 = "int" Local $wparam = DllStructCreate ($ptr1) If @error Then ;MsgBox(0, "", "Error in DllStructCreate " & @error); Return $EC_ERR EndIf Local $lparam = DllStructCreate ($ptr2) If @error Then ;MsgBox(0, "", "Error in DllStructCreate " & @error); DllStructDelete ($wparam) Return $EC_ERR EndIf Local $ret = GUICtrlSendMsg($h_edit, $EM_GETSEL, DllStructGetPtr ($wparam), DllStructGetPtr ($lparam)) You could use Local $PARAMS = "int;int" Local $wparam = 1, $lparam = 2 Local $p = DllStructCreate ($PARAMS) If @error Then ;MsgBox(0, "", "Error in DllStructCreate " & @error); Return $EC_ERR EndIf Local $ret = GUICtrlSendMsg($h_edit, $EM_GETSEL, DllStructGetPtr ($p,$wparam), DllStructGetPtr ($p,$lparam)) Start -> Programs -> AutoIt v3 -> AutoIt Help File -> Index -> (The Function you are asking about)----- Links -----DllStruct UDFsRSA Crypto UDFs Link to comment Share on other sites More sharing options...
GaryFrost Posted May 9, 2005 Share Posted May 9, 2005 I thought about changing them, me and you and more advanced user would understand them, so I left them alone so the novice user's could hopefully still follow them. SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. 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