FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Antonio: CHM Help
Posts: 56
Joined: Mon Jul 03, 2006 02:34 AM
Antonio: CHM Help
Posted: Thu May 29, 2008 12:01 AM
Antonio,

I'm now trying to use .chm help files via FWH syntax.

1. With .HLP files I just needed to do a

SET HELPFILE TO myhlphelp.hlp

and I could call up the help either by pressing F1 or by calling

WINHELP(GetHelpFile()).

2. With .CHM files it seems I need to do a

SET HELPFILE TO mychmhelp.chm

and I can call up the help either by pressing F1 or I must (?) call

CHMHELPTOPIC().

Note that calling WINHELP(GetHelpFile()) does nothing.

Also, even with the F1 key, although it works fine with the FWH .chm files, for some reason or other my own .chm file (which incidentally has no index entries), supplied by my client, seem to require

HELPSETTOPIC('WINHELP')

after the

SET HELPFILE TO mychmhelp.chm,

otherwise the 1st topic that pops up displays as a"This program cannot display the webpage" error (although any subsequent movement within the help file removes this message).
-------------

Temporarily, to save me making wholesale changes in my code to convert all references of

WINHELP(GetHelpFile())
to
CHMHELPTOPIC(),

I've now simply created my own WINHELP() function which calls
CHMHELPTOPIC().

Is calling CHMHELPTOPIC() the recommended way to invoke .chm help from a button / menu etc?

Previously, I've been successfully using
Winexec("HH.EXE " +"mychmhelp.chm")
to invoke .chm help from a button / menu etc. That works fine but I'd rather eliminate having to call WINEXE.exe and go the recommended FWH way instead.

TIA
Colin

(P.S. I looked in TESTHLP2.prg but it didn't seem to clarify the matter for me).
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Antonio: CHM Help
Posted: Thu May 29, 2008 09:09 AM

Colin,

Yes, chmHelpTopic( nHelpID / cTopic[.htm] ) --> nil is the way to review a topic.

FWH also provides (source\winapi\helpchm.prg):
function chmHelpIndex( cSearch )
function chmHelpSearch (cSearch )
function chmHelpPopup( cnHelp, nRow, nCol, oWnd ) // nrow, ncol are optional

Please review the documentation info provided inside helpchm.prg (at the end) for more details.

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Antonio: CHM Help
Posted: Thu May 29, 2008 09:15 AM

Colin,

>
HELPSETTOPIC('WINHELP')
after the
SET HELPFILE TO mychmhelp.chm,
>

Yes, thats the way we do it in samples\TestHlp2.prg

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 56
Joined: Mon Jul 03, 2006 02:34 AM
Antonio: CHM Help
Posted: Fri May 30, 2008 01:48 AM

Thanks Antonio. Where I was confused was that

SET HELPFILE TO mychmhelp.chm
HELPSETTOPIC('WINHELP')

allowed F1 to invoke help but, if I wanted to invoke help from a button or a menu, I had to call

CHMHELPTOPIC()

to get the same result.
(Incidentally, the chm file in the app I am working on is created by the client so I never know beforehand what topic names are in it. This doesn't seem to matter. The app is not required to have context-sensitive help.)

Anyway it seems to be working fine now.

Colin

Colin,

>
HELPSETTOPIC('WINHELP')
after the
SET HELPFILE TO mychmhelp.chm,
>

Yes, thats the way we do it in samples\TestHlp2.prg


regards, saludos

Antonio Linares


Continue the discussion