Jump to content
Sign in to follow this  
Ejoc

_GuiEdit

Recommended Posts

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

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...