ExecFile problems
Blitz3D Forums/Blitz3D Programming/ExecFile problems
| ||
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 |
| ||
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 |
| ||
Ok, thanks! I'll give it a try. |
| ||
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. |
| ||
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. |
| ||
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 |