News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

COM - Looking for the vf(..) macro/function

Started by K_F, August 14, 2013, 05:18:30 PM

Previous topic - Next topic

K_F

Hi.. I'm looking at some Direct2D examples and cannot find this.. function macro/listing.

example:>> invoke vf(g_brush,......)

If anyone knows which file it's in... pleeeeze show me!!

thanks
Van
'Sire, Sire!... the peasants are Revolting !!!'
'Yes, they are.. aren't they....'

qWord

For the case that the WinInc include files are used, take a look in winasm.inc (which is included through windows.inc).
;-------------------------------------------------------------------
; vf() is used to call a virtual method.
; it is intended to be used internally. MIDL will create C helper
; macros to access virtual methods with the following syntax:
;   #define Interface_Method() (This)->lpVtbl->Method(This,...)
; h2incx will translate this to:
;   Interface_Method macro This, ...
;   exitm <vf(This, Interface, Method), ...>
;   endm
;-------------------------------------------------------------------
; edx/r11 is used, so it cannot be used as a parameter!
; and global textequate ??thisreg is used
;-------------------------------------------------------------------
vf macro @this:req,interface,func:req
ifdef _WIN64
ifidni <@this>,<r11>
  ??thisreg equ <r10>
else
  ??thisreg equ <r11>
endif
else
ifidni <@this>,<edx>
  ??thisreg equ <ecx>
else
  ??thisreg equ <edx>
endif
endif
mov ??thisreg,@this
mov ??thisreg,[??thisreg].interface.lpVtbl
exitm <[??thisreg].&interface&Vtbl.&func&,@this>
endm

MREAL macros - when you need floating point arithmetic while assembling!

K_F

Quote from: qWord on August 15, 2013, 02:04:47 AM
.. take a look in winasm.inc (which is included through windows.inc).
Ah!!! thanks.. I missed that one... Thought I was really losing it !!
:t
'Sire, Sire!... the peasants are Revolting !!!'
'Yes, they are.. aren't they....'