Compiled HTML helpfile does not work when application is installed

C

Christie

My problem is that I am using a compiled HTML helpfile (.chm) for my
application help. I have copied the file to the bin directory and the
helpprovider component is pointing to the .chm file.

The code in the help button that displays the help is as follows:

Help.ShowHelp(Me,HelpProvider1.HelpNamespace)

It is working fine when I test the program, but once I publish it and
install it on another pc nothing happens when the help button is
clicked (not even an error message, nothing). This is very
frustrating.

Please point me in the right direction.

I am using Visual Studio 2005 (VB.Net).

Cheers
 
P

Peter Macej

It is very likely that CHM file on the target computer cannot be found.
Note that the system doesn't look in application's folder. Do you
specify the absolute full path to the CHM file? If not, do it on program
startup. Something like:

HelpProvider1.HelpNamespace =
IO.Path.Combine(System.Reflection.Assembly.GetExecutingAssembly.Location,
"myHelpFile.chm")
 
C

Christie

I have tried it with your code, but now I cannot get it to run, even
when I am debugging...I think my file is not located in the correct
area..
is the code that you gave my the only way to get the application path??
 
P

Peter Macej

Christie wrote / napísal(a):
I have tried it with your code, but now I cannot get it to run, even
when I am debugging...I think my file is not located in the correct
area..
is the code that you gave my the only way to get the application path??

I wrote the code from my memory. I forgot to get directory from
location. It should be:

HelpProvider1.HelpNamespace
=IO.Path.Combine(IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly.Location),
"myHelpFile.chm")

This works for me.
 
C

Christie

OK..I will try this...

One more question (a stupid one, I know) must I then have the .chm file
in the same directory as the program, or within one of the subfolders??
 
P

Peter Macej

One more question (a stupid one, I know) must I then have the .chm file
in the same directory as the program, or within one of the subfolders??

You can place the CHM file anywhere you want. But you always need to set
the full path so that your program can find it.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top