- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am having trouble using WinHelp in a context-sensitive mode (ie. using HELP_CONTEXT in the second argument. Any experience generating and using help files with CVF? I figured out that I need to use HCW.EXE to create my .HLP file but I'm stuck after that.
Link Copied
6 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I've used WinHelp in my QuickWin programs successfully--I haven't tried to use any true Win32 API programs with help, but it would probably be similar. I can think of three things--if these don't help, try to give a more specific description of how you're stuck.
1) make sure your help file works...in HelpWorkShop hit the "Run WinHelp" button (right of the "Compile" button), choose a "Mapped Topic ID" that corresponds to one of your popup definitions, then select "Open Help As If It Were...A pop-up", finally click "View Help." Your pop-up definition should appear--if not, you need to fix your help project (check your WinWord RTF file, be sure you used "footnotes" as described in HCW on-line help, make sure you have no compiler errors in HCW).
2) In CVF 5.0d I had to add a defintion for "integer, parameter :: HELP_FINDER #000B" which has probably been fixed in 6.x, but if you're running 5.x, you'll need to add that defintion somewhere (mine's with the definitions for IDH_xxx in a file called HELP.FD).
3) I used a code snippet like this to invoke help from the program...
! Context sensitive help if right-click on Mk81 display
if (mouseButton1.eq.1) then
i4 = IDH_DEFNOPOPUP
l4 = WinHelp(GetHwndQQ(QWIN$FRAMEWINDOW), 'MyHelpFile.hlp'C, &
HELP_CONTEXTPOPUP, %val(i4))
endif
You would want to set i4 to an appropriate IDH_DEFxxx based on the context that your user activated help from--in my final program the "if" statement in the snippet above was replaced by a "case" statement that used DefNoPopup if no pop-up was defined for the x-y position where the mouse was right-clicked.
Hope this helps...
vr/Bonesly_007
1) make sure your help file works...in HelpWorkShop hit the "Run WinHelp" button (right of the "Compile" button), choose a "Mapped Topic ID" that corresponds to one of your popup definitions, then select "Open Help As If It Were...A pop-up", finally click "View Help." Your pop-up definition should appear--if not, you need to fix your help project (check your WinWord RTF file, be sure you used "footnotes" as described in HCW on-line help, make sure you have no compiler errors in HCW).
2) In CVF 5.0d I had to add a defintion for "integer, parameter :: HELP_FINDER #000B" which has probably been fixed in 6.x, but if you're running 5.x, you'll need to add that defintion somewhere (mine's with the definitions for IDH_xxx in a file called HELP.FD).
3) I used a code snippet like this to invoke help from the program...
! Context sensitive help if right-click on Mk81 display
if (mouseButton1.eq.1) then
i4 = IDH_DEFNOPOPUP
l4 = WinHelp(GetHwndQQ(QWIN$FRAMEWINDOW), 'MyHelpFile.hlp'C, &
HELP_CONTEXTPOPUP, %val(i4))
endif
You would want to set i4 to an appropriate IDH_DEFxxx based on the context that your user activated help from--in my final program the "if" statement in the snippet above was replaced by a "case" statement that used DefNoPopup if no pop-up was defined for the x-y position where the mouse was right-clicked.
Hope this helps...
vr/Bonesly_007
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Steve!
The "code snippet" in my previous reply looked fine in the preview so rather than hitting "Edit" I hit "OK." But then, what posted didn't look like the preview...any clue as to how that happened? What if I try again...
! Context sensitive help if right-click on display
if (mouseButton1.eq.1) then
i4 = IDH_DEFNOPOPUP
l4 = WinHelp(gethwndqq(QWIN$FRAMEWINDOW), &
'APLT.HLP'C, HELP_CONTEXTPOPUP, %val(i4))
endif
vr/Bonesly_007
The "code snippet" in my previous reply looked fine in the preview so rather than hitting "Edit" I hit "OK." But then, what posted didn't look like the preview...any clue as to how that happened? What if I try again...
! Context sensitive help if right-click on display
if (mouseButton1.eq.1) then
i4 = IDH_DEFNOPOPUP
l4 = WinHelp(gethwndqq(QWIN$FRAMEWINDOW), &
'APLT.HLP'C, HELP_CONTEXTPOPUP, %val(i4))
endif
vr/Bonesly_007
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Trying the PRE tag...
! Context sensitive help if right-click on display if (mouseButton1.eq.1) then i4 = IDH_DEFNOPOPUP l4 = WinHelp(gethwndqq(QWIN$FRAMEWINDOW), & 'APLT.HLP'C, HELP_CONTEXTPOPUP, %val(i4)) endif
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Well, Bonesly_007, maybe I'm just having trouble figuring out what the four arguments in WinHelp are. The first argument is the window handle, the second is the .hlp file, but the last two arguments are quite a mystery. What is IDH_DEFNOPOPUP?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
For context sensative help I use :
lret=WinHelp (hWndMain,lpszHelp,HELP_CONTEXT,MapNum)
hWndMain is the handle of the main window.
lpszHelp is the location of the help file and is null terminated, i.e.
'c: est est.hlp'//c.
MapNum is integer*4 and relates to the number in the MAP section of the help project.
Hope this helps!
David
lret=WinHelp (hWndMain,lpszHelp,HELP_CONTEXT,MapNum)
hWndMain is the handle of the main window.
lpszHelp is the location of the help file and is null terminated, i.e.
'c: est est.hlp'//c.
MapNum is integer*4 and relates to the number in the MAP section of the help project.
Hope this helps!
David
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I was able to get David Graham's context-sensitive help routine to work just fine. Thanks David! Too bad this vital information seems missing (or incoherent) in the CVF manuals.
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page