MFC下的本地html(RoboHelp)索引在线帮助文​​件未打开

时间:2016-04-25 18:15:45

标签: c++ mfc chm html-help robohelp

我按照此处提到的所有说明进行操作:

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

我的CMainFrame :: HtmlHelp overiden处理程序如下所示:

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);


}

问题是永远不会打开帮助。我试图调试RoboHelp_CSH.cpp文件,我在第3267行发现了代码

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

bstr缓冲区末尾有一个额外的char,它产生以下代码

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);

}

失败。原始的szTempFile具有以下数据

C:\ Users \用户sdancer \应用程序数据\本地\ TEMP \ robohelp_csh.htm

和bstr以下(DC2是我在记事本++中显示的符号,在未看到VS2008我看到一个向上和向下箭头)。 C:\ Users \用户sdancer \应用程序数据\本地\ TEMP \ robohelp_csh.htm的 DC2

我在这里做错了什么?

0 个答案:

没有答案