ShowURL Question

I am shelling out to start a web program using a simple program like below I found in the examples. This is a service App so the Run code shown here is in a Run Event Handler under APP.

// This is the program//s main execution point
Dim sh as New Shell
sh.Execute (“StulzCalc.exe”) 'This works fine
ShowURL ("http://10.0.0.4 ")
// Note that on Windows, exiting the Run event
// does NOT terminate a service application. The
// service won//t terminate until the Stop event
// occurs. So to be consistent, lets just call
// quit with our exit code
'Quit(0)

I am getting an error that ShowURL doesn’t exist. Where am I going wrong?

ShowURL is not available in console builds, as per the documentation…

shao sean,

Thanks for that. So I made a stand alone app and need to be able to determine what the ip address of the computer is. Can I use a shell command to do this?

I am thinking something like this:
Dim sh as New Shell
sh.Execute(“Run”)
sh.Execute(“CMD”)
sh.Execute(“ipconfig”)
sh.Execute(“this is where I get lost. The computer maybe on wireless or wired connection”)
sh.Execute (“StulzCalc.exe”)
ShowURL (“http://10.0.0.3”)
Quit

Won’t Localhost work for your showurl?

Since you are targeting Windows, replace this:

ShowURL ("http://10.0.0.3")

With this:

sh.Execute ("start http://10.0.0.3")

Thanks again. I get the browser to open ok. What my problem is I won’t know what the ip address is for users. This little program needs to be able to determine the host computers ip address so I can use it with either method. Is there a way to get the ip address?

Tim suggested localhost. That is normally the way. On any computer and unless specified otherwise, locahost points to that computer IP. No need to find it out.

If you really want the IP, shell to ipconfig and parse the result.

As mentioned above, does this work:

sh.Execute("start http://localhost")

Neither of the commands work.
sh.Execute(“start http://localhost”)
sh.Execute (“start http://10.0.0.3”)

I checked and I am passing the correct shell path to run the Web App, but the browser comes back with the Message “Can’t Open This Page”

Is the web app running? What happens if you enter http://localhost directly in the browser?

[quote=147278:@Larry Cluchey]Neither of the commands work.
sh.Execute(“start http://localhost”)
sh.Execute (“start http://10.0.0.3”)

I checked and I am passing the correct shell path to run the Web App, but the browser comes back with the Message “Can’t Open This Page”[/quote]

Are you sure your web app is running ? If necessary, you want to launch it with a start as well.

If this is a standalone Xojo Web app, not putting any port address after localhost will get you a not found page error, unless you set the port to 80.

The proper syntax should be, for instance for a debug app which port number is 8080 :

http://localhost:8080

It appears that the app isn’t starting. So I need to figure out why not.

This is probably the problem. This runs the exe as a subprocess and will probably kill it when sh goes out of scope / is reused for another command. Use sh.Execute(“start StulzCalc.exe”) or better, get a folderitem to the exe and Launch it.

This could be it, so he would just have to create a shell class that remains while the program runs.

Could also be that he built a cgi app, which has an exe that does not run.

Thanks for all of your input. I got it going. The app wasn’t starting even though the path was correct. I moved it to a simpler path string and now everything works. Thanks again for everyone’s input and ideas.