Modify

#655 closed Feature Request (Rejected)

Suggestion: DllCall for pointers

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

Description

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 by Valik, on Nov 1, 2008 at 3:31:57 PM

Resolution: Rejected
Status: newclosed

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 by TicketCleanup, on Nov 1, 2008 at 4:00:01 PM

Milestone: Future Release

Automatic ticket cleanup.

comment:3 by wraithdu, on Mar 29, 2010 at 11:15:09 PM

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 by anonymous, on Aug 9, 2011 at 1:20:55 PM

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.

Modify Ticket

Action
as closed The ticket will remain with no owner.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.