Discussion:
Issue when specifying a search in a compiled HTML help file (.chm)
(too old to reply)
schneiju
2009-07-03 15:51:59 UTC
Permalink
Hello

has anybody seen such a behaviour before:
When I specify a search string (which exists) in the search box of a help
file and I press "list topic" the help process hangs.
In that case I opened the help file programmatically from within my original
SW the help is designed for.
(Initially everything is fine, help is available, contents are listed, index
topics are listed, just search is not working)

I used the following code:
HtmlHelp(GetDesktopWindow(), strHelpDesk, HH_DISPLAY_TOPIC, 0)
Where HTMLHelp translates to
Declare Function HtmlHelp Lib "hhctrl.ocx" Alias "HtmlHelpA" (ByVal
hwndCaller As Long, ByVal pszFile As String, ByVal uCommand As Long, ByVal
dwData As Long) As Long

When I open the same help via a shortcut in the start menu, the search works
perfectly fine!
("C:\WINDOWS\hh.exe" <Path>helpfile.chm)

The code to open the help wasn't changed for years now, and with older
versions of the SW everything was fine.
The help file itself was recompiled using the "same" properties as with the
old versions (at least we aren't aware of any change).

Does someone have an idea what can make searching in an HTML help file
behave so different, depending on how you opened the help?

Thanks
Juergen
Rob Chandler [MVP]
2009-07-06 01:11:27 UTC
Permalink
Hi Juergen
Ideas...
If the files in the chm have file names like *.h00.gif then the compiler can
think the file is a HTML file and parse it of info. If the compile completes
without
crashing, you can end up with garbage in the search index. In some cases
this can
cause problems.

Your help source does need to be fairly clean of this type of imperfection.
See here for more tips on Compiling
http://helpware.net/FAR/far_faq.htm#HTML_Help_Compilation
and on viewing
http://helpware.net/FAR/far_faq.htm#HTML_Help_Viewing

Other things to try...
Do a ChangeDir(GetDirPath(strHelpDesk)) just before you call help
as some help systems can get confused if the current directory is
not initially the Help directory.

We usually do the following

dir = GetCurrentDir();
ChDir(HelpDir);
OpenHelp;
ChDir(dir);

and it fixes a few problems.

Rob

Rob Chandler
MS Help MVP
http://helpware.net/
Post by schneiju
Hello
When I specify a search string (which exists) in the search box of a help
file and I press "list topic" the help process hangs.
In that case I opened the help file programmatically from within my
original SW the help is designed for.
(Initially everything is fine, help is available, contents are listed,
index topics are listed, just search is not working)
HtmlHelp(GetDesktopWindow(), strHelpDesk, HH_DISPLAY_TOPIC, 0)
Where HTMLHelp translates to
Declare Function HtmlHelp Lib "hhctrl.ocx" Alias "HtmlHelpA" (ByVal
hwndCaller As Long, ByVal pszFile As String, ByVal uCommand As Long, ByVal
dwData As Long) As Long
When I open the same help via a shortcut in the start menu, the search
works perfectly fine!
("C:\WINDOWS\hh.exe" <Path>helpfile.chm)
The code to open the help wasn't changed for years now, and with older
versions of the SW everything was fine.
The help file itself was recompiled using the "same" properties as with
the old versions (at least we aren't aware of any change).
Does someone have an idea what can make searching in an HTML help file
behave so different, depending on how you opened the help?
Thanks
Juergen
schneiju
2009-07-06 09:17:23 UTC
Permalink
Hi Rob

thanks for the quick response!
I checked if changing the directory does help in my case. Unfortunately not
for this issue.
I will check with our tech writer if the other sceanrio you described is
causing the issue and let you know as soon as I know more.

Thanks,
Juergen
Post by Rob Chandler [MVP]
Hi Juergen
Ideas...
If the files in the chm have file names like *.h00.gif then the compiler can
think the file is a HTML file and parse it of info. If the compile
completes without
crashing, you can end up with garbage in the search index. In some cases
this can
cause problems.
Your help source does need to be fairly clean of this type of
imperfection.
See here for more tips on Compiling
http://helpware.net/FAR/far_faq.htm#HTML_Help_Compilation
and on viewing
http://helpware.net/FAR/far_faq.htm#HTML_Help_Viewing
Other things to try...
Do a ChangeDir(GetDirPath(strHelpDesk)) just before you call help
as some help systems can get confused if the current directory is
not initially the Help directory.
We usually do the following
dir = GetCurrentDir();
ChDir(HelpDir);
OpenHelp;
ChDir(dir);
and it fixes a few problems.
Rob
Rob Chandler
MS Help MVP
http://helpware.net/
Post by schneiju
Hello
When I specify a search string (which exists) in the search box of a help
file and I press "list topic" the help process hangs.
In that case I opened the help file programmatically from within my
original SW the help is designed for.
(Initially everything is fine, help is available, contents are listed,
index topics are listed, just search is not working)
HtmlHelp(GetDesktopWindow(), strHelpDesk, HH_DISPLAY_TOPIC, 0)
Where HTMLHelp translates to
Declare Function HtmlHelp Lib "hhctrl.ocx" Alias "HtmlHelpA" (ByVal
hwndCaller As Long, ByVal pszFile As String, ByVal uCommand As Long,
ByVal dwData As Long) As Long
When I open the same help via a shortcut in the start menu, the search
works perfectly fine!
("C:\WINDOWS\hh.exe" <Path>helpfile.chm)
The code to open the help wasn't changed for years now, and with older
versions of the SW everything was fine.
The help file itself was recompiled using the "same" properties as with
the old versions (at least we aren't aware of any change).
Does someone have an idea what can make searching in an HTML help file
behave so different, depending on how you opened the help?
Thanks
Juergen
schneiju
2009-07-08 07:19:27 UTC
Permalink
Hi Rob

FYI, we could now identify the issue.
The reason is not the compiled help and also not the call to open the help
from within the application, but ...

and that's really strange...
we could trace the issue back to a .Net technology we used: System
Diagnostics tracing.
I have no clou how this interferes with the search functionality in the
online help, but I know for sure it does!

Thanks,
Juergen
Post by schneiju
Hi Rob
thanks for the quick response!
I checked if changing the directory does help in my case. Unfortunately
not for this issue.
I will check with our tech writer if the other sceanrio you described is
causing the issue and let you know as soon as I know more.
Thanks,
Juergen
Post by Rob Chandler [MVP]
Hi Juergen
Ideas...
If the files in the chm have file names like *.h00.gif then the compiler can
think the file is a HTML file and parse it of info. If the compile
completes without
crashing, you can end up with garbage in the search index. In some cases
this can
cause problems.
Your help source does need to be fairly clean of this type of
imperfection.
See here for more tips on Compiling
http://helpware.net/FAR/far_faq.htm#HTML_Help_Compilation
and on viewing
http://helpware.net/FAR/far_faq.htm#HTML_Help_Viewing
Other things to try...
Do a ChangeDir(GetDirPath(strHelpDesk)) just before you call help
as some help systems can get confused if the current directory is
not initially the Help directory.
We usually do the following
dir = GetCurrentDir();
ChDir(HelpDir);
OpenHelp;
ChDir(dir);
and it fixes a few problems.
Rob
Rob Chandler
MS Help MVP
http://helpware.net/
Post by schneiju
Hello
When I specify a search string (which exists) in the search box of a
help file and I press "list topic" the help process hangs.
In that case I opened the help file programmatically from within my
original SW the help is designed for.
(Initially everything is fine, help is available, contents are listed,
index topics are listed, just search is not working)
HtmlHelp(GetDesktopWindow(), strHelpDesk, HH_DISPLAY_TOPIC, 0)
Where HTMLHelp translates to
Declare Function HtmlHelp Lib "hhctrl.ocx" Alias "HtmlHelpA" (ByVal
hwndCaller As Long, ByVal pszFile As String, ByVal uCommand As Long,
ByVal dwData As Long) As Long
When I open the same help via a shortcut in the start menu, the search
works perfectly fine!
("C:\WINDOWS\hh.exe" <Path>helpfile.chm)
The code to open the help wasn't changed for years now, and with older
versions of the SW everything was fine.
The help file itself was recompiled using the "same" properties as with
the old versions (at least we aren't aware of any change).
Does someone have an idea what can make searching in an HTML help file
behave so different, depending on how you opened the help?
Thanks
Juergen
Rob Chandler [MVP]
2009-07-08 08:26:08 UTC
Permalink
Interesting. So are actually calling the Help API from C# code?
Post by schneiju
Hi Rob
FYI, we could now identify the issue.
The reason is not the compiled help and also not the call to open the help
from within the application, but ...
and that's really strange...
we could trace the issue back to a .Net technology we used: System
Diagnostics tracing.
I have no clou how this interferes with the search functionality in the
online help, but I know for sure it does!
Thanks,
Juergen
Post by schneiju
Hi Rob
thanks for the quick response!
I checked if changing the directory does help in my case. Unfortunately
not for this issue.
I will check with our tech writer if the other sceanrio you described is
causing the issue and let you know as soon as I know more.
Thanks,
Juergen
Post by Rob Chandler [MVP]
Hi Juergen
Ideas...
If the files in the chm have file names like *.h00.gif then the compiler can
think the file is a HTML file and parse it of info. If the compile
completes without
crashing, you can end up with garbage in the search index. In some cases
this can
cause problems.
Your help source does need to be fairly clean of this type of imperfection.
See here for more tips on Compiling
http://helpware.net/FAR/far_faq.htm#HTML_Help_Compilation
and on viewing
http://helpware.net/FAR/far_faq.htm#HTML_Help_Viewing
Other things to try...
Do a ChangeDir(GetDirPath(strHelpDesk)) just before you call help
as some help systems can get confused if the current directory is
not initially the Help directory.
We usually do the following
dir = GetCurrentDir();
ChDir(HelpDir);
OpenHelp;
ChDir(dir);
and it fixes a few problems.
Rob
Rob Chandler
MS Help MVP
http://helpware.net/
Post by schneiju
Hello
When I specify a search string (which exists) in the search box of a
help file and I press "list topic" the help process hangs.
In that case I opened the help file programmatically from within my
original SW the help is designed for.
(Initially everything is fine, help is available, contents are listed,
index topics are listed, just search is not working)
HtmlHelp(GetDesktopWindow(), strHelpDesk, HH_DISPLAY_TOPIC, 0)
Where HTMLHelp translates to
Declare Function HtmlHelp Lib "hhctrl.ocx" Alias "HtmlHelpA" (ByVal
hwndCaller As Long, ByVal pszFile As String, ByVal uCommand As Long,
ByVal dwData As Long) As Long
When I open the same help via a shortcut in the start menu, the search
works perfectly fine!
("C:\WINDOWS\hh.exe" <Path>helpfile.chm)
The code to open the help wasn't changed for years now, and with older
versions of the SW everything was fine.
The help file itself was recompiled using the "same" properties as with
the old versions (at least we aren't aware of any change).
Does someone have an idea what can make searching in an HTML help file
behave so different, depending on how you opened the help?
Thanks
Juergen
schneiju
2009-08-04 08:08:51 UTC
Permalink
Hi Rob

sorry for the late response...
actually we call the Help API from within VB6 code, but we use the tracing
mechanism of .Net in this VB component (we wrote a COM wrapper and call it
that way)

Juergen
Post by Rob Chandler [MVP]
Interesting. So are actually calling the Help API from C# code?
Post by schneiju
Hi Rob
FYI, we could now identify the issue.
The reason is not the compiled help and also not the call to open the
help from within the application, but ...
and that's really strange...
we could trace the issue back to a .Net technology we used: System
Diagnostics tracing.
I have no clou how this interferes with the search functionality in the
online help, but I know for sure it does!
Thanks,
Juergen
Post by schneiju
Hi Rob
thanks for the quick response!
I checked if changing the directory does help in my case. Unfortunately
not for this issue.
I will check with our tech writer if the other sceanrio you described is
causing the issue and let you know as soon as I know more.
Thanks,
Juergen
Post by Rob Chandler [MVP]
Hi Juergen
Ideas...
If the files in the chm have file names like *.h00.gif then the compiler can
think the file is a HTML file and parse it of info. If the compile
completes without
crashing, you can end up with garbage in the search index. In some
cases this can
cause problems.
Your help source does need to be fairly clean of this type of imperfection.
See here for more tips on Compiling
http://helpware.net/FAR/far_faq.htm#HTML_Help_Compilation
and on viewing
http://helpware.net/FAR/far_faq.htm#HTML_Help_Viewing
Other things to try...
Do a ChangeDir(GetDirPath(strHelpDesk)) just before you call help
as some help systems can get confused if the current directory is
not initially the Help directory.
We usually do the following
dir = GetCurrentDir();
ChDir(HelpDir);
OpenHelp;
ChDir(dir);
and it fixes a few problems.
Rob
Rob Chandler
MS Help MVP
http://helpware.net/
Post by schneiju
Hello
When I specify a search string (which exists) in the search box of a
help file and I press "list topic" the help process hangs.
In that case I opened the help file programmatically from within my
original SW the help is designed for.
(Initially everything is fine, help is available, contents are listed,
index topics are listed, just search is not working)
HtmlHelp(GetDesktopWindow(), strHelpDesk, HH_DISPLAY_TOPIC, 0)
Where HTMLHelp translates to
Declare Function HtmlHelp Lib "hhctrl.ocx" Alias "HtmlHelpA" (ByVal
hwndCaller As Long, ByVal pszFile As String, ByVal uCommand As Long,
ByVal dwData As Long) As Long
When I open the same help via a shortcut in the start menu, the search
works perfectly fine!
("C:\WINDOWS\hh.exe" <Path>helpfile.chm)
The code to open the help wasn't changed for years now, and with older
versions of the SW everything was fine.
The help file itself was recompiled using the "same" properties as
with the old versions (at least we aren't aware of any change).
Does someone have an idea what can make searching in an HTML help file
behave so different, depending on how you opened the help?
Thanks
Juergen
Loading...