Page 2 of 3
Help! on Help :)
Posted: Sun Aug 25, 2019 10:33 pm
by BiggyRat
Yes Robert I did, as I said to Karl earlier, CurPath() returns c:cavo28bin.
Meanwhile....
My Start() is
method Start() class App
//local oMainWindow as TopAppWindow
local oMainWindow as ShellWindow
Local cWorkDir, cPath as String
cPath := cWorkDir +", "+ cWorkDir+"Invoices" + ", "+ cWorkDir+"BizHelp"
SetPath(cPath)
oMainWindow := ShellWindow{self}
oMainWindow:HelpDisplay := HelpDisplay{"c:cavo28binBizHelpBizMan.CHM" }
oMainWindow:HelpDisplay:EnableHTMLHelp(true)
cWorkDir := WorkDir()
self:Initialize()
// oMainWindow := TopAppWindow{self}
oMainWindow := ShellWindow{self}
oMainWindow:Show(SHOWZOOMED)
oMainWindow:Caption := cAppVersion
VODBRddSetDefault("DBFCDX")
SetExclusive(FALSE)
SetDeleted(true)
oMainWindow:Icon := BM{}
oMainWindow:IconSm := BM{}
self:SetGlobalValues()
Run("FixOutlook2016.reg")
oMainWindow:EnableSystemMenu(FALSE)
SetNatDLL("BRITISH")
SetDateCountry ( BRITISH )
SetDateFormat("dd/MM/yyyy")
SetCentury(true)
SetAmPm(false)
SetThemeAppProperties(_or(STAP_ALLOW_NONCLIENT, STAP_ALLOW_CONTROLS, STAP_ALLOW_WEBCONTENT))
MainMenu{}:Show(SHOWCENTERED)
self:Exec()
Return self
Still makes no difference pressing the F1 key can bring up the QQout results, which means it's in the correct place I guess, but no actual help file is displayed.
BTW ? oMainWindow:HelpDisplay:EnableHTMLHelp(true)
returns NIL (after crashing the program)
Help! on Help :)
Posted: Mon Aug 26, 2019 2:48 am
by Jamal
The HelpDisplay class uses WinHelp() function which has compatibility issues in some versions of Windows.
If you want to simply display the CHM help, use:
Code: Select all
ShellExecute(null_ptr, psz("open"), String2Psz("c:cavo28binBizHelpBizMan.CHM"), null_ptr, null_ptr, SW_SHOW)
Help! on Help :)
Posted: Mon Aug 26, 2019 3:48 am
by lumberjack
Jeff,
BiggyRat wrote:
Code: Select all
cPath := cWorkDir +", "+ cWorkDir+"Invoices" + ", "+ cWorkDir+"BizHelp"
Just an observation, but probably not related to your issue:
Code: Select all
cPath := cWorkDir +"; "+ cWorkDir+"Invoices" + "; "+ cWorkDir+"BizHelp"
// Note "; " and not ", " for your PATH statement!!!
Help! on Help :)
Posted: Mon Aug 26, 2019 4:21 am
by BiggyRat
Help! on Help :)
Posted: Mon Aug 26, 2019 5:01 am
by lumberjack
Hi Jeff,
BiggyRat wrote:but I think that's a locale thing. I've been using semi colons in paths since the DOS 3 days
Yes I do <locale:realise|realize> it is a locale thing
Funny that you brought this up. Yes according to SA standards we use the ",". However, I have NEVER seen anybody in SA developing software that use it. Numerics are captured as "."
At a forestry scientific guidance meeting, we actually for scientific papers accepted a guideline that "." can be used as decimal separator for peer-reviewed articles. Same goes, we use 07:00 PM as well as 19h00 and mix and match them even in same sentences.
I am just not sure if ", " for PATH is actually producing the expected result...
Help! on Help :)
Posted: Mon Aug 26, 2019 5:07 am
by Karl-Heinz
Hi Jeff,
>> BTW ? oMainWindow:HelpDisplay:EnableHTMLHelp(true)
>> returns NIL (after crashing the program)
i only see NIL, when there´s no chm attached.
Code: Select all
oMainWindow := ShellWindow{self}
// oMainWindow:HelpDisplay := HelpDisplay{"c:cavo28binBizHelpBizMan.CHM" }
? oMainWindow:HelpDisplay:EnableHTMLHelp(true) // <----- NIL
Many years ago Phil wrote a help tutorial. If that doesn´t work for you, your machine has a serious help problem
https://www.helpandmanual.com/support_tutorials.html#vo
regards
Karl-Heinz
Help! on Help :)
Posted: Mon Aug 26, 2019 5:24 am
by lumberjack
Hi Jeff,
Not to bash, but there are a couple of anomalies for me if this is actually your real code without some deleted lines that you excluded in your post...
Code: Select all
//My Start() is
method Start() class App
Local cWorkDir, cPath as String
cPath := cWorkDir +", "+ cWorkDir+"Invoices" + ", "+ cWorkDir+"BizHelp"
// Note here, you assigning, but cWorkDir is actually not initialised yet...
oMainWindow:HelpDisplay := HelpDisplay{"c:cavo28binBizHelpBizMan.CHM" }
oMainWindow:HelpDisplay:EnableHTMLHelp(true)
cWorkDir := WorkDir()
// Again check here, you only assigning cWorkDir here, but you have already used it to set your PATH
// oMainWindow := TopAppWindow{self}
oMainWindow := ShellWindow{self}
// Again you initialise oMainWindow, so everything you have done so far on it, is NULLIFIED
oMainWindow:EnableSystemMenu(FALSE) // Do you not want to use the System Menu?
MainMenu{}:Show(SHOWCENTERED)
I think you need to bring some order to your start.
Code: Select all
FUNCTION Start()
// Get your working dirs in order
// Now do all your setups Set<Sets>()
// Now as last step get your ShellWindow setup
// Attach the HELP
// Show it
// Exec() your app
RETURN
HTH,
Help! on Help :)
Posted: Mon Aug 26, 2019 7:45 am
by BiggyRat
Hi Johan, thanks for that. Not bashing at all, I know it needs some serious cleaning up. Most of what's rubbish in there are left overs from trials and errors past.
Help! on Help :)
Posted: Mon Aug 26, 2019 7:54 am
by BiggyRat
Thanks Karl-Heinz, I have already got it, and am using it, which leads me to the question:
Why does this code from Johan work:
oMainWindow:HelpDisplay := HelpDisplay{"c:cavo28binBizHelpBizMan.CHM" }
and this code from the very example you're quoting:
oMainWindow:HelpDisplay := HelpDisplay{ cPath + "BizMan.CHM" }
Doesn't? when called in exactly the same way:
Local cHelpFile := WorkDir() +"; "+ WorkDir()+"Invoices" + "; "+ WorkDir()+"BizHelp" as String MY CODE
LOCAL cPath := "C:cavo28binBizHelp" as STRING Phils code
Help! on Help :)
Posted: Mon Aug 26, 2019 10:31 am
by Karl-Heinz
Hi Jeff,
> Why does this code from Johan work:
>
> oMainWindow:HelpDisplay := HelpDisplay{"c:cavo28binBizHelpBizMan.CHM" }
quite easy - path and filename are hardcoded
> and this code from the very example you're quoting:
>
> oMainWindow:HelpDisplay := HelpDisplay{ cPath + "BizMan.CHM" }
>
> Doesn't?
mmmh, when i change Phils code to:
LOCAL cPath := "C:cavo28help" AS STRING
...
oMainWindow:HelpDisplay := HelpDisplay{ cPath + "win32sdk.chm" }
...
and press F1 the WIN32-SDK Help opens ...
1. About your CurPath() , WorkDir() etc. attempts: You should better do it like others and i do - use SetDefault() and GetDefault() instead. When i start a app i check if it´s running within the IDE or as a exe. If the exe is running:
- cExeName := Execname ( true )
- extract the path from cExeName and make sure that "" is added
- store the content with SetDefault( <cPath> ). Now you always know the root dir of your app .
Because i know the subdir structure of my app i´m able to make a later call like:
oMainWindow:HelpDisplay := HelpDisplay{ GetDefault() + "HELP" + "myhelp.chm" }
2. With this method - which is part of my app subclass - i check if the app was started within the IDE
Code: Select all
METHOD isIde() CLASS DefApp
LOCAL lIDE AS LOGIC
IF ! ( GetEnv("VOCurrentPrjDir") == NULL_STRING )
lIDE := TRUE
ENDIF
RETURN lIDE
if the app was started within the IDE i can either hard code the SetDefault() value or get the value from e.g. a ini entry.
regards
Karl-Heinz