For example, there is a function named CreateFrame like,
virtual STDMETHODIMP CreateFrame(THIS_ LPCSTR Name,
LPD3DXFRAME*ppNewFrame);
I think STDMETHODIMP means It will return HResult and stdcall function, but I don't know what THIS_ in argument menas.
THIS_ is defined in combaseapi.h like this.
#define PURE = 0
#define THIS_
#define THIS void
For more information, the function 'CreateFrame ' is called automatically when D3DXLoadMeshHierarchyFromX is called.
Those are just old-school COM macros. Don't worry about them, especially since you are looking at the deprecated D3DX header for legacy Direct3D 9 from 13+ years ago...
This is a function that takes ONE parameter: the implicit
thispointer, returns anHRESULT, and is annotated for proper COM calling convention__stdcall.This is a function that takes THREE parameters: the implicit
thispointer, a pointer to a string, and a pointer to a specific object), returns anHRESULT, and is annotated for proper COM calling convention.To declare a function that returns a type other than
HRESULTyou'd useSTDMETHOD_:These old headers often also supported use from C rather than C++, where
thisis not implicit. Legacy D3DX never bothered with the C call-paths, but many old system headers did use them. In fact, if you did a little further incombaseapi.hyou'll see the C language section definesTHIS_andTHISas:The more modern MIDL compiler generates code that's slightly less confusing:
or