DllCall w/o function name Topic is solved

Get help with using AutoHotkey and its commands and hotkeys
madsounds
Posts: 53
Joined: 31 May 2019, 08:14

DllCall w/o function name

29 Jun 2020, 13:05

Now I'm trying to convert Webapp.ahk library to AHK2, and I found a strange line:

Code: Select all

r := DllCall( NumGet(NumGet(1 * pipa) + 5 * A_PtrSize)
            , "ptr", pipa
            , "ptr", &kMsg )
Why first parameter is a number and not a string containing function name?
User avatar
Delta Pythagorean
Posts: 574
Joined: 13 Feb 2017, 13:44
GitHub: DelPyth
Location: Somewhere in the US

Re: DllCall w/o function name

29 Jun 2020, 14:05

I'm not fully knowledgeable when it comes to programming so bare with me here.
When it comes to calling a function, you can either call by using the function's name, or it's "ID". Some functions allow their name while others use their ID's.

If I'm wrong, sue me.

- [AHK].......: 1.1.33.02 Unicode 64-bit
- [OS].........: Windows 10.0.19041
- [GITHUB]...: github.com/DeltaPyth
- [PAYPAL]....: paypal.me/DelPyth
- [DISCORD]..: Tophat Cat // Delta#8888

Remember to use [code]CODE[/code] for your multi-line scripts.
Stay safe, stay inside, and remember to wash your hands for 20 seconds!
awel20
Posts: 211
Joined: 19 Mar 2018, 14:09

Re: DllCall w/o function name  Topic is solved

29 Jun 2020, 14:06

It's a memory address for the function to call.
[v1.0.46.08+]: This parameter may also consist solely of an integer, which is interpreted as the address of the function to call. Sources of such addresses include COM and RegisterCallback().
https://www.autohotkey.com/docs/commands/DllCall.htm
There is a function called "vtable" in this example: https://www.autohotkey.com/docs/commands/DllCall.htm#ExTaskbar
If a COM object interface is not "IDispatch" then AHK can't call the object's functions by name through an AHK COM object that wraps the COM object interface. Instead, you are given an address of the vtable, and the vtable contains the addresses of the functions belonging to the object.
madsounds
Posts: 53
Joined: 31 May 2019, 08:14

Re: DllCall w/o function name

12 Jul 2020, 11:04

Okay thank you guys!

Return to “Ask For Help”

Who is online

Users browsing this forum: Bing [Bot], Google [Bot], LeonAskin, Spawnova, wineguy, XMCQCX, yoooooo and 55 guests