Modify

Opened 6 years ago

Last modified 9 months ago

#3160 assigned Feature Request

Allow Null to specify NULL pointer for more DllCall() pointer types.

Reported by: Valik Owned by: Jpm
Milestone: Component: AutoIt
Version: Severity: None
Keywords: Cc:

Description

I see that using the Null keyword with str and wstr parameters of DllCall() causes AutoIt to pass a NULL pointer. That's very useful. I'd like to see it extended to all pointer types. If I pass Null to a "DWORD*" it seems to treat it like I'm passing a pointer to a DWORD with value 0 as opposed to treating it as a NULL pointer. This behavior results in needing to write messy code like this:

Func FakeFunction($iParameter)
    Local $sParamType = "DWORD*"
    If $iParameter = Null Then $sParamType = "ptr"
    DllCall("fake.dll", "none", "FakeFunction", $sParamType, $iParameter)
EndFunc

FakeFunction(Null)

By allowing Null to specify a NULL pointer for all pointer types that code becomes:

Func FakeFunction($iParameter)
    DllCall("fake.dll", "none", "FakeFunction", "DWORD*", $iParameter)
EndFunc

FakeFunction(Null)

Much cleaner and easier to read and write.

Attachments (0)

Change History (1)

comment:1 Changed 9 months ago by Jpm

  • Owner set to Jpm
  • Status changed from new to assigned

Fix sent to Jon

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

Action
as assigned The owner will remain Jpm.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.