displaying resource file as Help

  • Thread starter Thread starter lord.zoltar
  • Start date Start date
L

lord.zoltar

Hello,
I have a help file as a chm, which is added to the project as a
resource. I'm trying to display it as
System.Windows.Forms.Help.ShowHelp(Me, "Name_Of_Helpfile_Resource")
which obviously does not work (It cannot find anything at that URL).
Is there a way to do this?
 
You want to leave these files out of your project in my opinion.

' Visual Basic
' This method takes parameters from the client application that allow
' the developer to specify when Help is displayed.
Public Sub DisplayHelp (ByVal parent as System.Windows.Forms.Control, _
ByVal topic as MyHelpEnum)
' The file to display is chosen by the value of the topic
' parameter.
Select Case topic
Case MyHelpEnum.enumWidgets
Windows.Forms.Help.ShowHelp(parent, "C:\Help\Widgets.chm")
Case MyHelpEnum.enumMechanisms
' Insert code to implement additional functionality.
End Select
End Sub
 
vbnetdev said:
You want to leave these files out of your project in my opinion.
Yeah I think you may be right about that I've tried a number of tricks,
and none of them really worked well...
Ok so here's the next problem: if I can't include the chm in the
project resources, how can I ensure the location in the filesystem that
will be installed at? The best place, I think would to just install it
in the same location as the executable file. I thought I could add it
through the Application Files (in "Project Settings -> Publish"), but I
can't. The program is being deployed throught ClickOnce, and I can't
seem to find much on how to control the install locations of files.
 
Yes in that case place them in your bin folder and use teh
application.startupPath placeholder to verify your contents are picked up
correctly. Whereever it is installed, here they will find it.

Now are you asking me in the setup project of how to force a install to a
certain path?
 
There is a section in the setup package that allows you "include files". I
would create a folder, put them in there and reference them with
Application.StartupPath with your folder name.
 
vbnetdev said:
There is a section in the setup package that allows you "include files". I
would create a folder, put them in there and reference them with
Application.StartupPath with your folder name.

Hmm somehow I can't seem to find it... :(
the closest I've gotten is the "Application Files" in the project's
Properties page. It shows me the files I can include or exclude, but I
can't add NEW files to this list - right now it just shows files such
as "myApp.exe".
I'm using VB .NET Express for this project...
 
Oh that changes things a bit. I don't think you have the setup wizard. In
the setup project can you right click on the project name and select view,
filesystem?

If so under application folder place your folder with the help files there.
(right click on Application Folder and select "Add Folder")
 
vbnetdev said:
Oh that changes things a bit. I don't think you have the setup wizard. In
the setup project can you right click on the project name and select view,
filesystem?

If so under application folder place your folder with the help files there.
(right click on Application Folder and select "Add Folder")

By "setup project", do you mean the project's Properties?

when you say to right-click the project name, that makes sense if
you're talking about the Solution Explorer... When I'm in the Solution
Explorer, I can right-click the project name and select "Add -> New
Folder". Of course, I can already see the chm file in the Solution
Explorer.
*sigh* so much easier with a makefile... hmm, is there some file I
could manually edit to get the chm to be included in the installation?
 
vbnetdev said:
No I dont mean this. Trying to compile some screenshots for you so stand by.

no no never mind!
I got what I needed. I selected the file in the Solution Explorer, then
selected the properties *for the file*! ...Then set the Build Type to
Content, then set the Copile Action to "Copy if newer"... Maybe that
wasn't what you meant either, but it got the job done.
 
no no never mind!
I got what I needed. I selected the file in the Solution Explorer, then
selected the properties *for the file*! ...Then set the Build Type to
Content, then set the Copile Action to "Copy if newer"... Maybe that
wasn't what you meant either, but it got the job done.

Sorry, "Build Type" should have read "Build Action" and "Compile
Action" should have read "Copy to Output Directory"...
thanks for all though! ;)
 
Back
Top