forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Crash using HELP facilities
Goto page Previous  1, 2
 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+
View previous topic :: View next topic  
Author Message
wahorger



Joined: 13 Oct 2014
Posts: 710
Location: Morrison, CO, USA

PostPosted: Tue Oct 29, 2019 10:12 pm    Post subject: Reply with quote

Thinking that there may be a memory allocation issue, I cut the size of a couple of dimensions by a factor of 10. This dropped the executable size (as reported by the Task Manager) from 884 MB to 336 MB.

Now, The help file loads. None of the images are displayed, but the text is there.

It also appears that the lookup token cannot be dynamically created; it must be statically allocated.
Back to top
View user's profile Send private message Visit poster's website
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 6205
Location: Salford, UK

PostPosted: Tue Oct 29, 2019 10:42 pm    Post subject: Reply with quote

With the changes that I outlined, I don't get any "lock ups" when running your sample.

I am not sure what you mean by "dynamically created" but if you can provide an example then I might be able to comment.

I am wondering if you understand that C-MasterHelp.chm should also run independently. For example you can run it directly from Microsoft file Explorer by double clicking on it (the chm file). But the version that you provide in the download is not yet fully functional. You can run it and view the help contents etc. but when you select a topic, the topic is not displayed.

I would only attempt to access C-MasterHelp.chm from your Fortran program after getting it to work independently as a stand-alone "application". (Actually its not an executable but is compiled hypertext that presumably the OS passes to the same "reader" that is used by Windows Explorer etc..)
Back to top
View user's profile Send private message
wahorger



Joined: 13 Oct 2014
Posts: 710
Location: Morrison, CO, USA

PostPosted: Tue Oct 29, 2019 11:28 pm    Post subject: Reply with quote

Hi Paul,

With the changes, and the test program, I don't get any lock-ups either.

But, these same commands and syntax (i.e. trailing NULL) still crash/lock when used in my full program. It works better (but not 100% successfully) if I drastically reduce my program size (static arrays).

I will use the USE_URL@ subroutine to get the help file displayed, and then the user can find the appropriate section. Or, I might be able to use the HH.EXE program. Still working on that last one, but Microsoft made it really hard.

The "dynamically" refers to the lookup token being passed as a character string. To this must be added a NULL, so if one just codes that in [//CHAR(0)], it is built on the stack (dynamically). That does not work. S, I have to create a static variable in that routine, and parse the token and add the NULL.

Bill
Back to top
View user's profile Send private message Visit poster's website
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 6205
Location: Salford, UK

PostPosted: Wed Oct 30, 2019 8:44 am    Post subject: Reply with quote

Bill

I have had another look at this but I have run out of time for now.

The following seems to work. I have also got it working with a simpler form but I am not sure that the simpler form is safe.

Code:
    character*260:: help_file='c-masterhelp.chm'
    character*24 verify,export,integrity,catalog
    verify = 'verify'//char(0)
    export = 'export'//char(0)
    integrity = 'integrity'//char(0)
    catalog = '"Catalog Search File"'//char(0)
    i = winio@('%ww[independent,not_fixed_size]&')
    i = winio@('%ca@&','Main Caption goes here')
    i = winio@('%mn[help[help1 - catalog]]&','HELP_LOOKUP',help_file,catalog)
    I = WINIO@('%mn[[help2 - verify]]&',     'HELP_LOOKUP',help_file,verify)
    I = WINIO@('%mn[[help3 - export]]&',     'HELP_LOOKUP',help_file,export)
    I = WINIO@('%mn[[help4 - integrity]]&',  'HELP_LOOKUP',help_file,integrity)
    i = winio@('%mn[[help5 - Full File]]&',  'HELP_CONTENTS',help_file)
Back to top
View user's profile Send private message
wahorger



Joined: 13 Oct 2014
Posts: 710
Location: Morrison, CO, USA

PostPosted: Wed Oct 30, 2019 5:56 pm    Post subject: Reply with quote

Thanks, Paul, for the effort. Since I'm not a Windows expert, there is little more that I can do also.

I have not abandoned the CHM file, nor incorporation into my software. I will use "use_url()' to open the help file for the user until I can get it to run in the same address space as my application.

I have some other things to try, but, like you, I have run out of time for this problem. Still thinking about it, though!

Bill
Back to top
View user's profile Send private message Visit poster's website
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 6205
Location: Salford, UK

PostPosted: Thu Oct 31, 2019 8:34 am    Post subject: Reply with quote

I have added an alternative to the standard callback HELP_LOOKUP. The alternative which has the name HELPLOOKUP takes a character variable that does not need the terminating null.

This will be available in the next release of the DLLs.

I think that this resolves the issue as far as it concerns ClearWin+.
Back to top
View user's profile Send private message
wahorger



Joined: 13 Oct 2014
Posts: 710
Location: Morrison, CO, USA

PostPosted: Thu Oct 31, 2019 2:57 pm    Post subject: Reply with quote

Thanks for your efforts, Paul.

An interesting factoid; HelpScribble will display the help file it is working on for you, but does so by running hh.exe with some command line processing of the file. I have yet to understand how they do this because the documentation I have on HH.EXE has yielded nothing of value (except how to decompile a CHM file). So, they run the help file in a separate address space.

I find that interesting.

Bill
Back to top
View user's profile Send private message Visit poster's website
wahorger



Joined: 13 Oct 2014
Posts: 710
Location: Morrison, CO, USA

PostPosted: Thu Oct 31, 2019 7:46 pm    Post subject: Reply with quote

Some of the problems I had with the test program were likely because the folder into which the Help File was placed was a mapped drive. And, you can't have a CHM file on a networked drive unless you undo the Microsoft Security in the registry. So there is that. I should have recognized this earlier.

As an FYI, my SW is run from a physical drive and the help file is also stored there, so I'm not running into that issue with my operational SW.

That said, there are still problems with the sample even when the file is on a regular drive. I get the same lock-ups, and the search does not yield the proper results.
Back to top
View user's profile Send private message Visit poster's website
wahorger



Joined: 13 Oct 2014
Posts: 710
Location: Morrison, CO, USA

PostPosted: Sat Jan 18, 2020 7:03 pm    Post subject: Reply with quote

Paul, thanks for the changes to the HELP function. Things are working better. Testing the code to implement the 'HELPLOOKUP' callback, I ran across a "limitation" that you should be aware of. None of this may be anything you have control over.

In the build of the HELP file, if there are two or more occurrences of a keyword, then the help processing will stall and the calling program must be terminated with the Task Manager. If there is only one occurrence of the keyword, then everything appears to work with no crashes.

With two or more occurrences, HELP will display a dialog box that shows the Topic pages that contain the keyword. It is when this is displayed that the program hangs up, or displays an "out of memory" dialog box then hangs up/crashes. This latter case is inconsistently occurring.
Back to top
View user's profile Send private message Visit poster's website
John-Silver



Joined: 30 Jul 2013
Posts: 1278
Location: Aerospace Valley

PostPosted: Sun Jan 19, 2020 9:02 pm    Post subject: Reply with quote

Hi Bill,

which version of windows are you using ?
have you tried a different version ?
HelpScribble - are you sure there's not something linked to using that ?

you're mightily honoured to have a machine with 32Gb memory !
are you sure all your users will have same, because if not, even if you run ok they could encounter problems.
I'm a bit disconcerted that your program shows using almost 1Gb useage just for searching in a HELP file !

JohnS
_________________
''Computers (HAL and MARVIN excepted) are incredibly rigid. They question nothing. Especially input data.Human beings are incredibly trusting of computers and don't check input data. Together cocking up even the simplest calculation ... Smile "
Back to top
View user's profile Send private message
wahorger



Joined: 13 Oct 2014
Posts: 710
Location: Morrison, CO, USA

PostPosted: Mon Jan 20, 2020 6:01 am    Post subject: Reply with quote

John, all your statements have value.

I do not have the ability to use a different OS. Windows 10 all around, I'm afraid. I do have Windows 10 Home on one.

In order to test whether HelpScribble is the culprit (certainly could be) I'd need a CHM file that had two topics with the same keywords built some other way. The problem is: How do you get the HHK file extracted from the CHM file? I think (do not know) that this might help.

I have written a pre-processor of the HelpScribble topic grid file to find all the occurrences of duplicated keywords. It is helping. It has found a couple of dupes. One thing that I do find interesting is the use of "nested index", where you have a subject and a sub-subject. I still need to verify, but I believe that I will not get a crash if two different topics contain the same nested index.

It is nice to have 32 gb, but since I only deal with the 32-bit FORTRAN, we have that overall limitation to deal with. And, yes, my users have (typically) 8-16 GB of memory.

As far as the overall program size, I have since reduced it to around 435 MB. One set of data was vastly over-allocated, and a smaller size would still do nicely.

Right now, invoking the Help file only increases the memory usage by about 22 MB, so should not be a problem.

Bill
Back to top
View user's profile Send private message Visit poster's website
wahorger



Joined: 13 Oct 2014
Posts: 710
Location: Morrison, CO, USA

PostPosted: Mon Jan 20, 2020 2:58 pm    Post subject: Reply with quote

Paul, I ahad a question regarding the HELP facility. It would appear that when I click the menu item to invoke the search of the HELP file for a keyword, that window gets minimized. Is this its normal behavior?

Bill
Back to top
View user's profile Send private message Visit poster's website
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 6205
Location: Salford, UK

PostPosted: Mon Jan 20, 2020 3:52 pm    Post subject: Reply with quote

Bill

I can't see anything in ClearWin+ for HELPLOOKUP that would cause the main window to minimise.

If you can provide a sample program then I could investigate further.
Back to top
View user's profile Send private message
wahorger



Joined: 13 Oct 2014
Posts: 710
Location: Morrison, CO, USA

PostPosted: Mon Jan 20, 2020 9:11 pm    Post subject: Reply with quote

I spent some time trying various things that match my code to get this to occur. No luck. If I have time, I will work on this some more; for now, I declare defeat.

I have an alternative that I'm confident will work, but will not give the same level of integration into the programs.

Bill
Back to top
View user's profile Send private message Visit poster's website
wahorger



Joined: 13 Oct 2014
Posts: 710
Location: Morrison, CO, USA

PostPosted: Thu Jan 23, 2020 1:17 pm    Post subject: Reply with quote

I tried this on Windows 10 Home. The window shows the text, but no images. On Windows 10 Pro, it locks up.

Since this particular HELP file did not have two topics with the same keyword, I cannot verify that the lock-up would not occur there.

Good news is that my "workaround" works. It is unsatisfying, but it does the job. It is HelpScribble specific. If anyone else needs this, PM me and I'll tell you what I had to do.

BTW, HelpScribble uses the Windows help compiler to create the CHM file. There may be some HelpScribble specific thing that is causing this behavior, but it would have to be undocumented both in HelpScribble and in Windows HHC.EXE.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+ All times are GMT + 1 Hour
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
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