Antonio: CHM Help

Antonio: CHM Help

Postby Colin Wisbey » 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).
Colin Wisbey
 
Posts: 56
Joined: Mon Jul 03, 2006 2:34 am

Postby Antonio Linares » Thu May 29, 2008 9: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
User avatar
Antonio Linares
Site Admin
 
Posts: 42122
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Antonio Linares » Thu May 29, 2008 9: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
User avatar
Antonio Linares
Site Admin
 
Posts: 42122
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Colin Wisbey » Fri May 30, 2008 1: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

---------------
Colin Wisbey
 
Posts: 56
Joined: Mon Jul 03, 2006 2:34 am


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 62 guests