Page 1 of 1
How to use WebControl to view local .html page?
Posted: Sat May 10, 2003 3:48 am
by LJ
Hi everyone. New message forum is great.
I am wondering is it possible to use the webcontrol to view a .html page stored in a directory?
The problem I'm having is that I want to view a .html web page that is stored in the local directory. I don't want to hard code the entire path name in the WebGadget line because if someone installs the program in a different directory, or different drive letter, it will not work. Is there a way to have the WebGadget display a .html page in the current directory? (The same directory that the .pb compiled file is in?)

Re: How to use WebControl to view local .html page?
Posted: Sat May 10, 2003 6:24 am
by PB
> Is there a way to have the WebGadget display a .html page in the
> current directory?
Just make the URL the name of the local file. (Incorrect example snipped)
Posted: Sat May 10, 2003 6:50 am
by LJ
The example you gave doesn't work... it says
Action cancelled... page not found
Posted: Sat May 10, 2003 7:03 am
by PB
> The example you gave doesn't work...
You're right -- I forgot that you
must use the full path.
Here's an updated example that gets the path of your running app before
calling the local file...
Code: Select all
If OpenWindow(0,200,200,450,200,#PB_Window_SystemMenu,"Test")
CreateGadgetList(WindowID())
appdir$=Space(255) : GetCurrentDirectory_(255,@appdir$) : If Right(appdir$,1)<>"\" : appdir$+"\" : EndIf
url$=appdir$+"LocalFile.htm"
WebGadget(0,5,5,440,190,url$)
Repeat
ev=WaitWindowEvent()
Until ev=#PB_EventCloseWindow
EndIf
Posted: Sat May 10, 2003 7:41 am
by LJ
You da bomb PB! That worked! If you have a chance to be the teacher and explain why it worked it would be very much appreciated oh wise guru. Thanks again!

Posted: Sat May 10, 2003 8:10 am
by PB
> If you have a chance to be the teacher and explain why it worked it
> would be very much appreciated
To be honest, I don't know why you need the full path -- I think it's just a
web browsing thing, just like you need a full URL when pasting into a web
browser to surf the net.
Posted: Sat May 10, 2003 6:29 pm
by ricardo
PB wrote:
To be honest, I don't know why you need the full path -- I think it's just a
web browsing thing, just like you need a full URL when pasting into a web
browser to surf the net.
I think that its because webbrowser its not like other gadgets, in fact 'maybe' the webbrowser working path is not the PB path but the IExplorer path.