Hi Dan,
Ahhh, Mr. Mfc ... out in front and pulling away ...
Works great ... I'd seen a reference in other places that sometimes you needed to specify the full path ... and didn't think to do that here. Gettin' groggy here in Blissful Colorado.
Thought I'd check ... is it ok to change the
AfxGetApp()->m_pszHelpFile
BOOL CInVerseApp::InitInstance(
{
...
char* pszHFP=(char*)AfxGetApp()-
int len = strlen(pszHFP);
pszHFP[len - 3] = '\0';
strcat(pszHFP,"chm");
int nResponse = dlg.DoModal();
if (nResponse == IDOK)
...
}
void CInVerseDlg::OnHelp()
{
const char* pszHFP=AfxGetApp()->m_pszH
HWND ret = HtmlHelp(NULL, pszHFP, HH_DISPLAY_TOC, NULL);
if (ret == 0) {
MessageBox("Can't display HH_DISPLAY_TOC",pszHFP);
}
}
void CInVerseDlg::OnHelpIndex()
{
const char* pszHFP = AfxGetApp()->m_pszHelpFile
HWND ret = HtmlHelp(NULL, pszHFP, HH_DISPLAY_INDEX, 0);
if (ret == 0) {
MessageBox("Can't display HH_DISPLAY_INDEX", pszHFP);
}
}
Thx again,
Lynn Allan
Main Topics
Browse All Topics





by: DanRollinsPosted on 2002-03-15 at 23:07:13ID: 6870518
You need to specify the full path to the .chm file. I don't know where (which directory) you have the chm file, but you can never depend upon a bar (pathless) filename.
Remember, when running from the IDE, your program is in the .\debug or .\release directory. I'm not sure what the 'current default' will be in that case. When ypou double-click in the explorer, the default directory will be the program directory.
BTW there is a variable in your CWinApp-derived class named m_pszHelpFilePath. I'm pretty sure that it is the path of the executable. You can use that to build a fully-qualified pathname for your chm file.
-- Dan