Opened 15 years ago

Closed 15 years ago

Last modified 13 years ago

#655 closed Feature Request (Rejected)

Suggestion: DllCall for pointers

Reported by: anonymous Owned by:
Milestone: Component: AutoIt
Version: Severity: None
Keywords: DllCall pointer Cc:


What about calling functions with their pointer?
Now we can create DLLCallBack functions, but not call them out of other DLLs.
Why not change the DLLCall to support them, e.g. if DLL is empty then the function name could be the Pointer.

$MOD = _WinAPI_LoadLibrary("Any.dll")
$TheFuncPtr = DllCall("Kernel32.dll","ptr","GetProcAddress","hwnd",$MOD,"str","FuncName")
$TheFuncPtr = $TheFuncPtr[0]
DllCall("", "none", $TheFuncPtr, "hwnd", $param1, "long", $param2)

Attachments (0)

Change History (4)

comment:1 Changed 15 years ago by Valik

  • Resolution set to Rejected
  • Status changed from new to closed

I'm astounded, truly. Did you even bother to think about how DllCall() might work for even a moment? Clearly not. There is no reason to call a function by pointer because as your code demonstrates in order to get a pointer you have to call LoadLibrary() and GetProcAddress() which is what DllCall() does already.

comment:2 Changed 15 years ago by TicketCleanup

  • Milestone Future Release deleted

Automatic ticket cleanup.

comment:3 Changed 14 years ago by wraithdu

I'd like to lobby that this feature request be reconsidered. This would be useful functionality for calling functions from DLLs embedded and loaded to memory (MemoryDll UDF) or for object function pointers (as in the AutoItObject project). In the latter case, you can still manually do this without AIO by creating the object vtables, but you are still left with only function pointers and no native way to call them.

There are workarounds for this, like in the MemoryDll UDF and AutoItObject, but none are very pretty.

This should be trivial to implement unless I'm mistaken, just skip the LoadLibrary/GetProcAddress steps in the DllCall process. No?

comment:4 Changed 13 years ago by anonymous

I'd really like to see this feature. Now there is even a libTCC-libary for AutoIt where you need to call a function by its pointer.
It shouldn't be too difficult to check the whether the tpye of the function name is pointer in order to choose between LoadLibrary/GetProcAddress and pointer call.

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

as closed The ticket will remain with no owner.

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

Note: See TracTickets for help on using tickets.