I just don't get it, what's with this->?
I’m looking at some code to help me understand how to use the dbghelp.dll Windows stack walking and symbol discovery stuff and the code I’ve found on the net uses a programming style that I’ve seen a few times before and have never understood the reason for.
if (this->m_sw->pSGSFA(this->m_hProcess, s.AddrPC.Offset,
&(csEntry.offsetFromSmybol), pSym) != FALSE)
{
strcpy_s(csEntry.name, pSym->Name);
// UnDecorateSymbolName()
this->m_sw->pUDSN( pSym->Name,
csEntry.undName, STACKWALK_MAX_NAMELEN,
UNDNAME_NAME_ONLY );
this->m_sw->pUDSN( pSym->Name, csEntry.undFullName,
STACKWALK_MAX_NAMELEN,
UNDNAME_COMPLETE );
}
else
{
this->OnDbgHelpErr("SymGetSymFromAddr64", GetLastError(), s.AddrPC.Offset);
}
Why did the author feel it necessary to be explicit about his use of the current object by specifying this->
when accessing members? Where did this style come from and what purpose is it supposed to serve?