I am reading Essential COM and encountered a macro 'BASE_OFFSET' from chapter 2 of the book and I don't really understand its syntax or why it's done that way.
#define BASE_OFFSET(ClassName, BaseName) \
(DWORD_PTR(static_cast<BaseName*>(reinterpret_cast<ClassName*>(0x10000000))) - 0x10000000)
Can anyone explain this macro and how we use this? In fact, the book uses this macro but since I don't really understand it, I don't see the practical usage of it. Thank you very much in advance.