LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Displays more than one HTML help (.chm) file

Solved!
Go to solution

I have two HTML help (.chm) files: USER_HELP_FILE and ERR_HELP_FILE

when I open USER_HELP_FILE selecting a menu item my source code is the following:


int status;
status = ShowHtmlHelp(NULL, HH_CLOSE_ALL, NULL);
status = ShowHtmlHelp(USER_HELP_FILE, HH_DISPLAY_TOC, NULL);

 

the same when I open ERR_HELP_FILE

 

int status;
status = ShowHtmlHelp(NULL, HH_CLOSE_ALL, NULL);
status = ShowHtmlHelp(ERR_HELP_FILE, HH_DISPLAY_TOC, NULL);

 

using these instructions in Operative System Windows10 all was ok

using these instructions in Operative System Windows11 when I open the second HTML help (.chm) file, the first one is not closed and the second is not correctly open. After some seconds my application crash

 

Could you please help me? Thank you very much 

 

0 Kudos
Message 1 of 6
(140 Views)

The usual answer to questions like these is: do functions return any error? I.e. is there some meaningful value in 'status' variable on the defective systems?

 

After that, you could search into the event viewer any error message related to your application and see if it sheds some light on the situation.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 2 of 6
(115 Views)

when I open the first HTML help (.chm) file:

the status = ShowHtmlHelp(NULL, HH_CLOSE_ALL, NULL); has value = -5001

the status = ShowHtmlHelp(XXX_HELP_FILE, HH_DISPLAY_TOC, NULL); has value = 0

but the first HTML help (.chm) file is open correctly 

 

when I open the second HTML help (.chm) file:

the status = ShowHtmlHelp(NULL, HH_CLOSE_ALL, NULL); has value = -5001

the status = ShowHtmlHelp(XXX_HELP_FILE, HH_DISPLAY_TOC, NULL); has value = 0

 

error -5001 = "Could Not Open File For Reading"

But I don't understand, because I use the instruction ShowHtmlHelp(NULL, HH_CLOSE_ALL, NULL); to close all HTML help (.chm) files previous opened...

 

Could you please help me? Thank you very much

0 Kudos
Message 3 of 6
(104 Views)

I cannot help you since I am not using ShowHtmlHelp function, but since it is distributed in the Programmer's Toolbox whose source code is available you could place a breakpoint in it and run it step-by-step: this way you will be able to detect the exact function that returns the error.

 

Apart from this, I wonder if passing a full pathname to the function wouldn't help.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 4 of 6
(92 Views)
Solution
Accepted by topic author dorianp69

finally a colleague of mine solved the problem:

https://stackoverflow.com/questions/81243/opening-two-htmlhelp-files-simultaneously-in-delphi-causes...

the problem was that in the help name there are spaces:

sprintf( USER_HELP_FILE, "%s\\help\\%s\\User Manual.chm", DIR_BASE, LANGUAGE);

I correct it in:

sprintf( USER_HELP_FILE, "%s\\help\\%s\\User_Manual.chm", DIR_BASE, LANGUAGE);

I rename the file .chm from "User Manual.chm" to "User_Manual.chm"

and all works properly!!!

0 Kudos
Message 5 of 6
(73 Views)

Ah, we couldn't have guessed it not knowing the file names!

I'm glad you solved your problem.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 6 of 6
(48 Views)