Solved

Calling a Help File

Posted on 1998-12-07
3
156 Views
Last Modified: 2010-05-03
Hi
I am using VB3 and i need to know how to call my help file i have created for my application
I have a menu cammand called Help
in the help procedure i placed this code
CMDialog1.HelpFile = "c:\dial\dial.hlp"
CMDialog1.HelpCommand = cdlHelpContents
CMDialog1.ShowHelp  ' Display Visual Basic Help contents topic.

i placed a common dialog control on the form
this works perfectly in VB5 but in VB3 it gives me an error "Type mismatch" on line 3
it does not like  CMDialog1.ShowHelp

please help
thanx craig
0
Comment
Question by:CraigLazar
  • 2
3 Comments
 
LVL 2

Accepted Solution

by:
trillo earned 30 total points
ID: 1448549
Why dont you use the WinHelp function, It's easier and you don't need the DialgoBox control to be there.

This is the 32bit declaration, but look in your API text viewer for the correct declaration at VB3.
Declare Function WinHelp Lib "user32" Alias "WinHelpA" (ByVal hwnd As Long, ByVal lpHelpFile As String, ByVal wCommand As Long, ByVal dwData As Long) As Long
Parameters:
hwnd: Handle of the window requesting help.
lpHelpFile: string with the path and name of the helpfile
wCommand: (See below)
dwData: Depends on wCommand

Values for wCommand
HELP_CONTENTS = Displays the contents of the help file. dwData is ingored.
HELP_CONTEXT = Displays a specific topic, where the topicID is defined with the dwData parameter.
HELP_HELPONHELP      = Displays how to use windows help. dwData is ingored.
HELP_INDEX = Displays the index. dwData is ingored.

You can find the values for these constants at the API text viewer.

Trillo
0
 
LVL 4

Author Comment

by:CraigLazar
ID: 1448550
Hi T
Thanx for your response and i appologize for not getting back to u sooner i am on three projects at once .
anyway
i found the vb3 version of winhelp
could you help on clearing up the first parameter for me hwind
sais it is a handle to the form i want to place it in the main form , is this write ?
then is it possible to call my help file from the menu.(So it displays the help file)

this is what i have so far
"my declare is "
Declare Function WinHelp Lib "User" (ByVal hwnd As Integer, ByVal lpHelpFile As String, ByVal wCommand As Integer, dwData As Any) As Integer
Dim temphelp As Integer


"this is in form load"
temphelp = user("c:\dial\dial.hlp", help_contents)

thanx mate
C
0
 
LVL 2

Expert Comment

by:trillo
ID: 1448551
The hwnd parameter is the handle of the Help file's owner window. This means that you can assign a "parent" window for hte Help file, so when you are displaying the help file of your app, if you close your program, your help file will be closed too.

For example, place this in response to some button or menu:

Call WinHelp(Me.hwnd, "c:\dial\dial.hlp", HELP_CONTENTS, 0)

Note that the functions is "WinHelp"... (not "user".. user is the name of the DLL where the "WinHelp" function resides)
Note also that you have to declare the HELP_CONTENTS variable, you should copy this, and the other values form the API text viewer, from the Constants section... (Note that they are all uppercase) I'll post them to you here, but I copied these from the VB4 API text viewer, so there are maybe some of them that weren't availabel in VB3

Public Const HELP_COMMAND = &H102&
Public Const HELP_CONTENTS = &H3&
Public Const HELP_CONTEXT = &H1          '  Display topic in ulTopic
Public Const HELP_CONTEXTPOPUP = &H8&
Public Const HELP_FINDER = &HB
Public Const HELP_FORCEFILE = &H9&
Public Const HELP_HELPONHELP = &H4       '  Display help on using help
Public Const HELP_INDEX = &H3            '  Display index
Public Const HELP_KEY = &H101            '  Display topic for keyword in offabData
Public Const HELP_MULTIKEY = &H201&
Public Const HELP_PARTIALKEY = &H105&
Public Const HELP_QUIT = &H2             '  Terminate help
Public Const HELP_SETCONTENTS = &H5&
Public Const HELP_SETINDEX = &H5         '  Set current Index for multi index help
Public Const HELP_SETWINPOS = &H203&


Trillo
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

912 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now