Can you change fp_htmlHelp to false in the first if() in this code (help_plugin.cpp:121) and try again?
wxThread::ExitCode LaunchCHMThread::Entry()
{
if (fp_htmlHelp) // do it our way if we can
{
cbHH_AKLINK link;
link.cbStruct = sizeof(cbHH_AKLINK);
link.fReserved = FALSE;
link.pszKeywords = m_keyword.c_str();
link.pszUrl = NULL;
link.pszMsgText = NULL;
link.pszMsgTitle = NULL;
link.pszWindow = NULL;
link.fIndexOnFail = TRUE;
#if defined(_WIN64) | defined(WIN64)
fp_htmlHelp(0L, (const wxChar*)m_filename, cbHH_KEYWORD_LOOKUP, (DWORDLONG)&link);
#else
fp_htmlHelp(0L, (const wxChar*)m_filename, cbHH_KEYWORD_LOOKUP, (DWORD)&link);
#endif
}
else // do it the wx way then (which is the same thing, except for the 0L in the call to fp_htmlHelp)
{
m_helpctl.KeywordSearch(m_keyword);
}
return 0;
}
BTW, shouldn't #if defined(_WIN64) | defined(WIN64)
be #if defined(_WIN64) || defined(WIN64)
?
Effectively, il I change
by
At line 82, fp_htmlHelp is already set to 0 (<=> false) and setting it to 1 is not correct.
and
#if defined(_WIN64) | defined(WIN64)
by
#if defined(_WIN64) || defined(WIN64)
it works again.
It is a problem quite similar to the one described in https://forums.codeblocks.org/index.php/topic,24363.msg166592.html#msg166592, a pointer to an address with the wrong length on Windows 64 bits, which seems to be a problem on very recent gcc versions.
fp_htmlHelp is volatile and created each time, no ?
No, it is the address of a procedure in HHCTRL.OCX and it is assigned once in the plugin constructor:
ocx_module = LoadLibrary(_T("HHCTRL.OCX"));
if (ocx_module)
fp_htmlHelp = (HTMLHELP)GetProcAddress(ocx_module, HTMLHELP_NAME);
with HTMLHELP_NAME = "HtmlHelpW".
If the OCX can't be opened or the procedure is not found then the code on line 121 uses wxWidgets' wxCHMHelpController (m_helpctl).
I wanted to force the use of m_helpctl in order to discard (or blame) the other code.
Probably
#if defined(_WIN64) | defined(WIN64)
fp_htmlHelp(0L, (const wxChar*)m_filename, cbHH_KEYWORD_LOOKUP, (DWORDLONG)&link);
#else
fp_htmlHelp(0L, (const wxChar*)m_filename, cbHH_KEYWORD_LOOKUP, (DWORD)&link);
#endif
can be just
fp_htmlHelp(0L, (const wxChar*)m_filename, cbHH_KEYWORD_LOOKUP, (DWORD_PTR)&link);