Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Calling a Help File

Posted on 1998-12-07
3
Medium Priority
?
162 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 2

Accepted Solution

by:
trillo earned 120 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library 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.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Suggested Courses

715 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