 |
forums.silverfrost.com Welcome to the Silverfrost forums
|
View previous topic :: View next topic |
Author |
Message |
KennyT
Joined: 02 Aug 2005 Posts: 318
|
Posted: Tue Jan 24, 2012 7:17 pm Post subject: Accessing .chm files from FTN95 |
|
|
I've got a compiled help (.chm) file that I'd like to access various pages from to provide context sensitive help. I think the winAPI function I'd like to call is "HtmlHelp" (see http://msdn.microsoft.com/en-us/library/ms670172.aspx)
So, I've tried various declaration statements:
C_EXTERNAL HTMLHELP '__HtmlHelp' (VAL, STRING, VAL, VAL) : INTEGER*4
C_EXTERNAL HTMLHELP '_HtmlHelp' (VAL, STRING, VAL, VAL) : INTEGER*4
C_EXTERNAL HTMLHELP 'HtmlHelp' (VAL, STRING, VAL, VAL) : INTEGER*4
C_EXTERNAL HTMLHELP '__htmlhelp' (VAL, STRING, VAL, VAL) : INTEGER*4
C_EXTERNAL HTMLHELP '_htmlhelp' (VAL, STRING, VAL, VAL) : INTEGER*4
C_EXTERNAL HTMLHELP 'htmlhelp' (VAL, STRING, VAL, VAL) : INTEGER*4
But whatever I tried, it comes up as an undefined external at link time.
What have I missed!?
TIA
K
edit: I've also tried (taken from another forum question):
STDCALL HTMLHELP 'HtmlHelpA' (VAL,STRING,VAL,VAL):INTEGER*4
LIBRARY "c:\windows\system32\hhctrl.ocx"
but it didn't help.
K
OK, sussed it! The OCX file needs to be included in the link script!
K |
|
Back to top |
|
 |
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2402 Location: Yateley, Hants, UK
|
Posted: Wed Jan 25, 2012 9:10 pm Post subject: |
|
|
Looks wrong to me. You can run CHM files using HH.EXE. Here's my routine for doing so. It is a callback to the Help menu item:
Code: | INTEGER FUNCTION IHELPSYS()
C --------------------------
CHARACTER*(256) PNAME
INCLUDE <WINDOWS.INS>
C -----------------------------------------------------------------
IHELPSYS = 1
CALL GET_PROGRAM_NAME@ (PNAME)
CALL UPCASE@ (PNAME)
N = LEN_TRIM (PNAME)
IF (PNAME (N-5:N) .EQ. 'XX.EXE') THEN
N = N - 6 ! Assumes XX.EXE
CALL START_PPROCESS@('HH.EXE',PNAME(1:N)//'WSXHelp.chm')
ELSE
DO 10 I=1,N
J = N + 1 - I
IF (PNAME(J:J) .EQ. '\') GO TO 20
10 CONTINUE
RETURN
20 CALL START_PPROCESS@('HH.EXE',PNAME(1:J)//'XXHelp.chm')
ENDIF
END |
It is only the CALL START_PPROCESS that you need: I assume that the CHM is in the same folder as the EXE.
Any help?
Eddie |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8210 Location: Salford, UK
|
Posted: Thu Jan 26, 2012 9:44 am Post subject: |
|
|
Both approaches are viable. The first may give more control over direct access to particular topics etc. |
|
Back to top |
|
 |
KennyT
Joined: 02 Aug 2005 Posts: 318
|
Posted: Thu Jan 26, 2012 10:00 am Post subject: |
|
|
True. Using HtmlHelp, I can kick off the compiled help file at a particular topic, on a particular page. But I think the same is true of "HH":
"HH helpfile.chm::/document.htm#title"
seems to work as well.
There are other options with HtmlHelp, though, for example to start the help file at the index tab. Not sure how to do that with "HH".
K |
|
Back to top |
|
 |
KennyT
Joined: 02 Aug 2005 Posts: 318
|
Posted: Thu Oct 04, 2012 3:50 pm Post subject: |
|
|
one problem i have with using the HtmlHelp method is that printing fails. The call i'm making is:
Code: |
STDCALL HTMLHELP 'HtmlHelpA' (VAL, STRING, VAL, VAL) : LOGICAL*4
.
.
.
CTEMP = "helpfile.chm::/document.htm#title"
LRET = HTMLHELP (0,CTEMP, 0, 0)
|
But perhaps the "zeroes" should be something else?
K |
|
Back to top |
|
 |
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2402 Location: Yateley, Hants, UK
|
Posted: Thu Oct 04, 2012 3:57 pm Post subject: |
|
|
Kenny,
Doesn't HH start at the index tab if you don't give it instructions to start elsewhere?
My HH (Win 7 32) has a Home toolbar button to get to the start, the tree can be shown or removed, and there is a print button.
Eddie |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8210 Location: Salford, UK
|
Posted: Thu Oct 04, 2012 4:37 pm Post subject: |
|
|
If HtmlHelp requires a NULL value for an argument then you should pass CORE4(0). |
|
Back to top |
|
 |
KennyT
Joined: 02 Aug 2005 Posts: 318
|
Posted: Fri Oct 05, 2012 2:01 pm Post subject: |
|
|
I tried passing core4(0) and it didn;t help.
The print button is there, but it just comes up with a popup ("An error occurred with this operation"). The printer selection dialogue briefly flashes first.
I should say that the printing function works OK if I use "HH" or just double click the CHM file.
K |
|
Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|