HTML帮助,VC 2008调用替代应用程序的功能,从VC6升级后出现问题 [英] HTML help, VC 2008 calls overriding app's function, problems after upgrade from VC6

查看:94
本文介绍了HTML帮助,VC 2008调用替代应用程序的功能,从VC6升级后出现问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个VC ++ 2008 MDI项目,该项目的左窗格为CTreeView,右窗格为带有属性页的属性表. (这是从VC 6.0升级的项目,并且WinHelp系统运行良好.顺便说一句,chm文件是相同的.)

在我的应用程序("theApp")中,我调用了EnableHtmlHelp()以及我的函数:

void CWinApp :: HtmlHelp(DWORD_PTR dwData,UINT nCmd)

从那里,使用HH_HELP_CONTEXT命令调用:: HtmlHelp()函数.

右窗格的属性表具有预翻译功能,该功能捕获F1按键,并将对话框帮助索引传递给"theApp"中的HtmlHelp函数.将显示正确的主题帮助,如在VC 6.0中一样.

CTreeView类CLeftView还捕获F1按键,并将树项的帮助索引传递给"theApp"中的HtmlHelp函数.由于某种原因,该调用被具有默认主帮助主题的MFC Wincore.cpp中对HtmlHelp的另一次调用覆盖,而不是针对树项发送的主题. (我也尝试用相同的结果捕获子框架中预翻译中的F1键.)

I have a VC++ 2008 MDI project which has a left pane of a CTreeView and the right pane is a property sheet with property pages. (This is a project which was upgraded from VC 6.0 and the WinHelp system worked great. The chm file is the same by the way.)

In my application (''theApp'') I have the call to EnableHtmlHelp() plus my function:

void CWinApp::HtmlHelp(DWORD_PTR dwData, UINT nCmd)

From there, the ::HtmlHelp() function is called using the HH_HELP_CONTEXT command.

The right pane property sheet has the pre-translate function which captures the F1 key press and passes the dialog help index to the HtmlHelp function in ''theApp''. The correct topic help is displayed as it used to in VC 6.0.

The CTreeView class CLeftView also captures the F1 key press and passes the tree item''s help index to the HtmlHelp function in ''theApp''. For some reason this call is overridden by another call to the HtmlHelp in MFC''s Wincore.cpp with the default main help topic instead of the one that was sent for the tree item. (I have also tried to capture the F1 key in the pretranslate in the Child Frame with the same results.)

Any ideas what may be causing the problem?

推荐答案

我找到了解决问题的方法,现在帮助系统针对用户的特定树项返回了自定义的帮助主题.已开启.

我从CLeftView(左窗格)中删除了PreTranslateMsg()函数,并将OnCommandHelp()函数添加到了子框架中:

ChildFrm.h
afx_msg LRESULT OnCommandHelp(WPARAM wParam,LPARAM lParam);

ChildFrm.cpp
LRESULT CChildFrame :: OnCommandHelp(WPARAM wParam,LPARAM lParam)
{
if((lParam == 0)&&(GetLeftPane()!= NULL))
{
theApp.HtmlHelp(GetLeftPane()-> m_dwCurItem,HELP_CONTEXT);
返回TRUE;
}

返回FALSE;
}
I found a solution to the problem and now the help system returns a customized help topic for the specific tree item the user is on.

I removed the PreTranslateMsg() function from the CLeftView (left pane) and added the OnCommandHelp() function to the Child Frame:

ChildFrm.h
afx_msg LRESULT OnCommandHelp(WPARAM wParam, LPARAM lParam);

ChildFrm.cpp
LRESULT CChildFrame::OnCommandHelp(WPARAM wParam, LPARAM lParam)
{
if((lParam == 0) && (GetLeftPane() != NULL))
{
theApp.HtmlHelp(GetLeftPane()->m_dwCurItem, HELP_CONTEXT);
return TRUE;
}

return FALSE;
}


这篇关于HTML帮助,VC 2008调用替代应用程序的功能,从VC6升级后出现问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆