Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

WhatsThis CHM File Problem

Status
Not open for further replies.

PaulHInstincticve

Programmer
May 31, 2006
45
GB
Until recently my VFP9 application used both F1 and ? WhatsThis help quite successfully on all Windows platforms. My main F1 help was a CHM file and my whatsthis help was a HLP file. Recently, however, I upgraded to Vista and of course discovered that Microsoft are now making HLP help obsolete - thanks fellas! I therefore updated my app to use CHM whatsthis files. I imported my HLP file into Help and Manual help system and quickly converted it to a CHM file (which was a piece of cake I should add) and then made a one line change to my program and hey presto - it worked! Problem is, however, it worked on my Vista PC which is also the development PC. I foolishly (or perhaps not!) assumed that because it worked there it would on all platforms, however, I now find that on XP SP2 (and perhaps other platforms not yet tried) when I click the whatsthis button then click on a field that has whatsthis help behind it then nothing happens. I have no idea why not. Can anyone point me in the right direction?

I used the following command to initialise my whatsthis help file originally, this worked on all platforms except Vista

SET HELP TO WHATSTHIS.HLP

I changed this to

SET HELP TO WHATSTHIS.CHM

this works fine on Vista but not on XP SP2

For my F1 context sensitive help, I used the some rather complicated code, which I do not profess to understand. This has remained unchanged and appears to work on ALL platforms - I just copied it and it works and has done for some years. I shouldn't need to bother you with that but just thought I would mention it briefly in case it has any relevance. Here is a sample of part of the code in use. Obviously I pass in certain parameters before it is activated

DECLARE INTEGER HtmlHelp IN "HHCtrl.ocx" AS "HtmHelpA" ;
INTEGER nHWND, ;
STRING cHelpFile, ;
INTEGER nCommand, ;
STRING cTopic
*!* Get the active window handle
DECLARE INTEGER GetFocus IN "user32" AS "GetFocus"
wHnd = GetFocus()
IF wHnd = 0
=MESSAGEBOX("Unable to get window handle.")
RETURN
ENDIF
*!* Call the HTML help system
nRetVal = HtmHelpA(@wHnd, @cHelpFile, @nCommand, cTopic)


Can anyone tell me why my whatsthis help using CHM files instead of HLP files works on Vista but not on XP SP2? Any help really appreciated. Thanks

Paul
 
Don't worry, I think I have sorted the problem myself. It appears that I need to ask Installshield Express to install the VFP Help Runtime files for me. Even though I have never installed these before, there must have been sufficient runtimes already installed in the operating systems for the way I was previously doing things. Now that set help to points to a CHM files instead of HLP file, however, I need to include them but obviously already had them on my Vista development machine. Hope this thread is of use to someone else doing the same thing though!

Paul
 
Hi Paul,

First, WhatsThisHelp has never really worked properly with CHM files. This is true on all platforms (even Windows 98). What usually happens is that when the user activates WhatsThisHelp, the full help viewer opens, rather than just the little popup window. This is not what you want.

That said, it doesn't explain why you are not seeing any help at all in those circumstances.

Second, Microsoft recently issued a security patch for CHM files that prevent them from working across a network under XP. Is it possible that your XP systems expect to find the CHM files on a file server? If so, try moving them to the local hard drive, and see what effect that has.

I would also try temporarily removing the F1 code that you posted, to see if that has any effect. This code shouldn't be necessary. VFP itself should handle F1, for both CHM and HLP files.

Hope this helps.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
Mike,

Thanks for coming back. Sorry that I must have solved this whilst you were still responding, a flash of inspiration must have come over me. Regarding Whatsthis and CHM files not working well, not really sure why you say that. I am using Help and Manual to compile my help files following being converted to it very recently indeed, the icing on the cake before I purchased was the way it let me convert a HLP file I had used for years into a CHM in a matter of minutes in order to become Vista compatible. I noticed another contact who you responded to about help problems some 12 months back was also using Help and Manual. One of the compilation options allows me to create popup style help without headings, navigation panels etc so it does just what my HLP always did but now has the added advantage that it looks a lot better with its hyperlinks, stylesheets etc which I did not have with the old Microsoft Help Workshop tool I was using previously. I would thoroughly recommend it for this job.

Regarding the other code, I appreciate that it could be removed. I think the reason it is there is so that F1 and Whatsthis can coexist in two different files. I suspect there may be scope in the future for bringing them into the same CHM file, however, this may stop my 'popup' affect on the whatsthis, besides, I do believe 'if it ain't broke, don't fix it'! Thanks again

Paul
 
Paul,

I also use Help & Manual. I've been using it for years, and would hate to have to switch to another authoring tool.

Re the issue of displaying WhatsThisHelp as a small popup rater than a full-blown help viewer window. My understanding is that this is a function of the Windows help system rather than of any particular authoring tool. In my own work, I've had very good results using WhatsThisHelp with HLP files. But when I've tried it with CHMs, I see the full viewer window. Admittedly, you can switch off the Contents, Index and Search panes, but you stil see the full viewer frame than a simple popup.

Of course, I might be wrong about this. If there is in fact some way that H&M can solve the problem, I'd like to try it, but I can't see any obvious setting for this. (BTW, I'm using H&M 4.0.3; how about you?).

Mike




__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
Hi Mike,

Just to complete this: I'm sure with the change from HLP to CHM the main problem was not that Windows security fix issue, but the vfp help runtimes missing, VFP9: foxhhelp9.exe and foxhhelpps9.dll.

The Windows security fix is no problem, if the CHM is on a local drive and will not cause nothing to happen, but display some message in the help window "page cannot be displayed". See on how to fix this.

Bye, Olaf.
 
Mike,

At last - a time for me to help you rather than you help me!!! Yes I am using Help and Manual 4.2. I remember struggling with this at first and contacted the people who write it and they could not really help me suggesting that this was really something specific to VFP rather than Help and Manual and then suddenly I stumbled across it in system, now if only I could remember what I stumbled upon!!! Looking at Project Properties for my help file, WinHelp Options tab, I have removed ticks off 'maximise window' and also all the 'visible buttons' ticks. On the HTML Help options tab I then have 'allow secondary HTML help windows' ticked. In the HTML Help area I then have under 'popup topics' 'text only popups' set. Under 'browser based help', 'popup topics' there is an option - 'Javascript Popups'. I do not remember changing that one but if you read it it says that the standard option will only produce main window help which is not really what popups are about but with the Javascript option on Java enabled browsers you get full HTML enabled popups.

As I say I am not entirely sure which setting suddenly involked just what I needed and it was probably the combination of a few but my popups work as popups from VFP 9, I have font styles in there as well as hyperlinks and although I have not needed graphics so far in my whatsthis popup help so far I suspect it can handle it equally well. If you want to download the app and see for yourself you are welcome to download it from Once you have installed with setup.exe you can log in using 'Admin' as the userid and 'Admin' as the password. Go to 'Setup', 'General', 'Web Details', click on the second tab and click '?' followed by the 'Outlook Redemption' field to see popup help using a hyperlink and click '?' then 'Letter Addressing Start' field to popup help which uses a combination of normal and bold font.

Yes great system Help and Manual, cannot believe I struggled on for so long with Microsoft Help Workshop for both my HLP and CHM files. Time to dump the HLP files now with Vista though and get your CHM files working properly!

Hope this helps

Paul
 
Olaf,

Yes the network issue was some time back. At the start of my app now I always check sys(5) to see if its running on C:. If it is then I just open my help file in the current directory. If its not I look for a directory on the c: drive called c:\myapp. If its there I look for the presence of a file c:\myapp\myhelp.chm. If its there I check the date and time stamp and compare to the one on the network server. If its older or not there then I simply copy it from the server to the c: drive and include that file in the set help to at the start of the app. This means that every user has a copy of the help file on their c: drive even though the rest of the app sits on the server but each update themselves whenever I update the help file on the server (or next time the workstation logs in I should say!).

Another nasty I spotted recently while we are on the subject is F1 help not working and giving a table of contents as expected on the left panel but 'This Program Cannot Display The Web Page' on the right hand side where the main help body should be. This was caused by a security update in Windows XP (and possibly others) where if the help file was installed using a setup program it ran fine, but if I then sent a help file update perhaps just as a zip file to be extracted over the original then a security update prevented it from running. The solution was to right click on the help file update after installation, choose 'properties' and then 'unblock' (a button which only appears when the file needs unblocking and then disappears altogether afterwards).

Hope this is also of benefit to others who might be struggling as I was in this area.

Paul
 
Paul,

My version of H&M appears to have all the settings you described. I should have been more assiduous in looking for them. Many thanks for pointing me in that direction.

I'll certainly take a look at your app when I can grab a moment. It looks interesting.

(And what a great place to work you've got - almost on the Pennine Way, as far as I can see.)

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
Mike,

Yes, 4 miles overland to the start of the Pennine Way (about 11 miles by road!). Did the walk in reverse a year this March having done it the other way about 20 years back, remember the really cold spell for about 3 weeks? We spent 13 days in sub zero temperatures backpacking the 260 or so mile route doing YHA, B&B etc where possible but camping several nights! Fantastic to walk all that way HOME from up your neck of the woods and the conditions made it amazing - frozen rivers, frozen waterfalls, great sunshine etc. Definitely recommended if you haven't done the whole trek yet!

Paul
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top