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: 1434
Joined: 13 Aug 2016, 21:04
Contact:

Is ComObjValue the same as comobj.ptr?

Post by iseahound » 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

Post by swagfag » 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: 9553
Joined: 30 Sep 2013, 04:07
Contact:

Re: Is ComObjValue the same as comobj.ptr?

Post by lexikos » 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).

Post Reply

Return to “Ask for Help (v2)”