What is the c++ approach for upgrading these c style casts for HtmlHelp API?
void CMeetingScheduleAssistantApp::DisplayHelpTopic(CString strTopic)
{
CString strURL = _T("https://help-msa.publictalksoftware.co.uk/") + strTopic;
if (theApp.UseDownloadedHelpDocumentation())
{
// CHM files use 3 letter suffix
strTopic.Replace(_T(".html"), _T(".htm"));
HtmlHelp((DWORD_PTR)(LPCTSTR)strTopic, HH_DISPLAY_TOPIC);
}
else
ShellExecute(nullptr, nullptr, strURL, nullptr, nullptr, SW_SHOWDEFAULT);
}
Specifically:
HtmlHelp((DWORD_PTR)(LPCTSTR)strTopic, HH_DISPLAY_TOPIC);
In answer to the question in the comments:
It is odd because the official docs for x86 HtmlHelpA / HtmlHelpW do indicate different calls.
It doesn't seem to be listed as part of the CWinApp class in the docs.

In that case, you could invent your own pointer cast function. A smart compiler will most probably optimize this away:
Then
In g++ and clang++, explicitly instantiating the function
makes it into the assembly code
When inlined and optimized (as it will be in your code) the function call is gone and only the
mov(assignment) to the destinationDWORD_PTRis left, which is exactly the trace areinterpret_castwould leave. In MSVC, inlining it results in the similar: