Is ComObjValue the same as comobj.ptr? Topic is solved

Get help with using AutoHotkey (v2 or newer) and its commands and hotkeys
iseahound
Posts: 1444
Joined: 13 Aug 2016, 21:04
Contact:

Is ComObjValue the same as comobj.ptr?

17 Oct 2021, 21:17

Is ComObjValue the same as retrieving the pointer via comobj.ptr? It seems rather redundant.
swagfag
Posts: 6222
Joined: 11 Jan 2017, 17:59

Re: Is ComObjValue the same as comobj.ptr?  Topic is solved

17 Oct 2021, 21:59

its meant for IDispatch wrapped objects iirc(where .Ptr would be trying to invoke a property that likely doesnt exist)
lexikos
Posts: 9583
Joined: 30 Sep 2013, 04:07
Contact:

Re: Is ComObjValue the same as comobj.ptr?

21 Oct 2021, 17:14

This is explicitly documented, including the purpose of the redundancy, the more restrictive conditions which set Ptr apart from ComObjValue, and the additional capability of Ptr not supported by ComObjValue.
https://lexikos.github.io/v2/docs/commands/ComValue.htm#Ptr

Edit: It's not meant for IDispatch wrapped objects, and does not function with VT_DISPATCH. It is meant for non-IDispatch derived interfaces (but also valid for VT_BYREF and VT_ARRAY).

Return to “Ask for Help (v2)”

Who is online

Users browsing this forum: hisrRB57, pafec, Super Foxy and 22 guests