However, the results are not matching as expected and the reason is that SOMETIMES the buffer is being created with the same pointer.
How can I ensure a unique buffer pointer for each variable?
Code: Select all
pLeft := ComValue(VT_BYREF := 0x4000 | VT_I4 := 3, A := Buffer(4).ptr)
pTop := ComValue(VT_BYREF := 0x4000 | VT_I4 := 3, B := Buffer(4).ptr)
pRight := ComValue(VT_BYREF := 0x4000 | VT_I4 := 3, C := Buffer(4).ptr)
pBottom := ComValue(VT_BYREF := 0x4000 | VT_I4 := 3, D := Buffer(4).ptr)
pHit := ComValue(VT_BYREF := 0x4000 | VT_I4 := 3, E := Buffer(4).ptr)
MsgBox(A '`n' B '`n' C '`n' D '`n' E)
; The function I need is GetRect of type ITextDocument.Range
; https://learn.microsoft.com/en-us/windows/win32/api/tom/nf-tom-itextrange2-getrect