Local html (RoboHelp) index online help file under MFC is not opened

168 views Asked by At

I followed all the instructions that is referred here :

http://help.adobe.com/en_US/robohelp/robohtml/WS5b3ccc516d4fbf351e63e3d11aff59c571-7f43.html

My CMainFrame::HtmlHelp overiden handler looks like this :

void CMainFrame::HtmlHelp(DWORD_PTR dwData, UINT nCmd)
{
    // TODO: Add your specialized code here and/or call the base class

    CWaitCursor wait; 
    // Get the path to the Help system  
    CWinApp* pApp = AfxGetApp(); 
    ASSERT_VALID(pApp); 
    // Set the path to server-based help  
    CString csOnlineHelpPath = _T("C:\\Help\\Final\\index.htm"); 
    PrepareForHelp(); 
    // must use top level parent (for the case where m_hWnd is in DLL)  
    CWnd* pWnd = GetTopLevelParent(); 
    // finally, run the RoboHelp Help engine 
    if (!RH_ShowHelp(pWnd->m_hWnd, csOnlineHelpPath, nCmd, dwData)) 
        AfxMessageBox(AFX_IDP_FAILED_TO_LAUNCH_HELP);


}

The problem is that the help is never opened. I tried to debug the RoboHelp_CSH.cpp file and I found out that at the line #3267 with the code

MultiByteToWideChar(CP_ACP, MB_USEGLYPHCHARS, szTempFile, (int)uLen, bstr, uLen+1);

the bstr buffer have an extra char at the end that makes the following code

hr=s_pstBrowser->Navigate(bstr, &vFlags, &vTargetFrameName, &vPostData, &vHeaders); 

HWND hWnd;
hr=s_pstBrowser->get_HWND((long*)&hWnd);
if (SUCCEEDED(hr))
{
    ::SetForegroundWindow(hWnd);
}
::SysFreeString(bstr);

}

to fail. The original szTempFile has the data below

C:\Users\sdancer\AppData\Local\Temp\robohelp_csh.htm

and the bstr the the following (the DC2 is the symbol I show inside notepad++, unside VS2008 I see an up and down arrow). C:\Users\sdancer\AppData\Local\Temp\robohelp_csh.htmDC2

What am I doing wrong here ?

0

There are 0 answers