ExecFile problems

Blitz3D Forums/Blitz3D Programming/ExecFile problems

dgroncki(Posted 2004) [#1]
I have a function that is suppose to launch a help file in a browser:

Function ShowHelp()
sFile$ = CurrentDir$() + "\help\help_main.htm"
ExecFile(sFile$)
End Function

On a couple machines, this works fine. But on most, when the function is run, the game window that runs this function loses focus (the titlebar dims), but the help file never launches. If on these machines I double-click the htm file itself, it comes up fine, so I don't think it is an association issue.
Any ideas?
thanks...Dave


_PJ_(Posted 2004) [#2]
change to:

Function ShowHelp() 
  sFile$ = "help\help_main.htm" 
  ExecFile(sFile$) 
End Function 


Make sure any OpenDir 's are Closed before this function is called. Also, you sometimes really have to give it time to open the browser, as Blitz is quite processor hungry, so things like this take that little bit longer


dgroncki(Posted 2004) [#3]
Ok, thanks! I'll give it a try.


Boiled Sweets(Posted 2004) [#4]
I think you need to specify a full path i.e. c:\data\help\help.htm"...

If you do use a path that contains a space then stick the " char at the beginning and end like below...

ExecFile(Chr$(34)+ "c:\program files\game\help\help_main.htm" + Chr$(34)) 


Hope that helps ya.


Zethrax(Posted 2004) [#5]
You could also try using a Delay() to give control of the cpu back to windows for the delay period, which may improve the time it takes for the browser window to open.


Perturbatio(Posted 2004) [#6]
At a guess, I would say that it is a combination of Malice's and Boiled's solutions that you need. It *might* be that when you run it on the systems that don't launch, you have the executable in a folder (or a subfolder of a folder) that has a space in it's name.

If this is the case, simply appending and prepending quotes to the full qualified path should resolve this.

Function ShowHelp() 
  sFile$ = chr$(34) + CurrentDir$() + "help\help_main.htm" + Chr$(34)
  ExecFile(sFile$) 
End Function