Web Browser: Customize On-The-Fly

General HouseBot discussion. Any issues that don't fit into any of the other topics belong here.
Osler
HouseBot Guru
Posts: 742
Joined: Fri Feb 03, 2006 11:18 pm

Post by Osler »

Here it is. Download the latest version here:

REMOVED

Please delete any previous device versions from previous installs (Browser1 and ExternalControl) and use the included .hbx to import the devices new. Properties have been deleted as I felt they were a bit superfluous and increased the complexity of the devices. Deleted properties include:

Red
Blue
Green
Offset
FlatBrowser

I have opted to present the browser as always flat and only showing the browser panel with no borders. The option for scrollbars is still present and now includes a fix so that frames are displayed correctly on certain pages.

The biggest change is the use of command line parameters for the program (thanks to dlmorgan999). The parameters that can be passed follow the syntax used by Scott in External Control and are as follows:

/P [IP Address of HouseBot server]
/O [Port number of external control device]
/S [Password of external control device - if no password and asterix (*) must be passed]
/D [Name of the device in HouseBot controlling the browser]
/C [instance type of browser application - SIB = single instance browser and MIB = multi-instance browser]

Example usage in Execute Program Device argument property:

/P 127.0.0.1 /O 5000 /S * /D Browser1 /C SIB

Let me know how it is working for you and definately report any bugs you discover.

Osler
Last edited by Osler on Wed Feb 04, 2009 11:10 pm, edited 1 time in total.
Osler
HouseBot Guru
Posts: 742
Joined: Fri Feb 03, 2006 11:18 pm

Post by Osler »

I just re-read the posts and see that markd had an issue when I thought it was roussell.

markd, did you get this to work yet or are you still having issues?

Osler
dlmorgan999
HouseBot Special Member
Posts: 409
Joined: Tue Jul 13, 2004 9:13 am
Location: Tigard, OR

Post by dlmorgan999 »

I'm glad the command line tip worked out well! :D I hadn't thought of also it using to replace your parameter file - that was a good idea.

I will install the new version tomorrow morning and give it a good test. I'll let you know how it comes out.

-- Dave
dlmorgan999
HouseBot Special Member
Posts: 409
Joined: Tue Jul 13, 2004 9:13 am
Location: Tigard, OR

Post by dlmorgan999 »

The new version using parameters is working great for me! :D I did thorough testing on the SIB/MIB parameter and it worked perfectly. Thanks for the enhancement!

-- Dave
markd
Advanced Member
Posts: 234
Joined: Fri Jul 21, 2006 4:32 pm

Post by markd »

Osler wrote:I just re-read the posts and see that markd had an issue when I thought it was roussell.

markd, did you get this to work yet or are you still having issues?

Osler
I still can't run the install- just tried the new one and get the same results. Could not create directory. I tried changing the default, doesn't seem to matter, I get the same error.

I tried to figure out what the install (last version, not this one) was doing so I could do it all manually, but I must have missed something, not having any luck. :-(

Thanks for following up!

Markd
dlmorgan999
HouseBot Special Member
Posts: 409
Joined: Tue Jul 13, 2004 9:13 am
Location: Tigard, OR

Post by dlmorgan999 »

It appears I spoke too soon! :( I just integrated the new version of the executable into my production environment. When I open the remote the first time it works great. If I close the remote and open it again though I get another instance of HouseBot_Browser.exe even though I'm using the SIB parameter to start it (at least that what's appears to be happening).

My initial testing was done running the browser on the same server as the HouseBot server. The production testing above was done running a remote on a separate PC. What code are you using to detect the presence of an existing browser? Would you mind sending me the current version of the VB project?

-- Dave
dlmorgan999
HouseBot Special Member
Posts: 409
Joined: Tue Jul 13, 2004 9:13 am
Location: Tigard, OR

Post by dlmorgan999 »

In case it would be helpful, here are a few links to pages that show how to get information on the running processes. The last link is probably the best and most current:

http://support.microsoft.com/kb/187913

http://www.thescarms.com/vbasic/RunningProcs.asp

http://www.vbaccelerator.com/home/Vb/Ti ... rticle.asp

If you already have code to handle this then I'm not sure what's happening in my situation. I'll be happy to help debug though if that would be useful.

-- Dave
Osler
HouseBot Guru
Posts: 742
Joined: Fri Feb 03, 2006 11:18 pm

Post by Osler »

markd:

You don't have to use the installer....its just a convenience. All you need to do is ensure the HBControlMod.dll and ccrpTmr6.dll are registered. Once that is done the executable should have no problems. Both dll's and the executable can be located in the Support folder of the download. Try registering the dll's and bag the installer program.

dlmorgan999:

Hehe...alright, the way I check the instance ain't as robust as the API calls. I was trying to avoid this. I am testing the App.PrevInstance boolean to check it. Now, one of the problems I encountered was if I enclosed the command line arguments in quotes (e.g., "/P 127.0.0.1 blah blah /C SIB"), the quote is added to the InstanceType parameter in the code (i.e., InstanceType = SIB" and not plain old SIB). If you are using quotes, try foregoing them and see if it fixes the problem. If this is the case I will go back and enhance the string manipulations I am doing to make sure this doesn't happen. If the variable InstanceType is anything BUT SIB, a multi-instance application is spawned (i.e., default).

Osler
dlmorgan999
HouseBot Special Member
Posts: 409
Joined: Tue Jul 13, 2004 9:13 am
Location: Tigard, OR

Post by dlmorgan999 »

I'll play around with your suggestions a bit - thanks. If that doesn't work I've already done most of the work needed to detect using the APIs (from the last link I sent you). If I can't get it to work using the method you suggested I would be happy to add the API support to your code if you like.

-- Dave
Osler
HouseBot Guru
Posts: 742
Joined: Fri Feb 03, 2006 11:18 pm

Post by Osler »

dlmorgan999:

No problem. Just let me get it zipped up so you can download it. I am just getting done for the day so I'd like to get some wine in me and work on the "butt groove" in the couch a bit first. I'll post the source in a bit.

Osler
Osler
HouseBot Guru
Posts: 742
Joined: Fri Feb 03, 2006 11:18 pm

Post by Osler »

Uploaded from "the groove":

REMOVED

Osler
Last edited by Osler on Wed Feb 04, 2009 11:10 pm, edited 1 time in total.
dlmorgan999
HouseBot Special Member
Posts: 409
Joined: Tue Jul 13, 2004 9:13 am
Location: Tigard, OR

Post by dlmorgan999 »

Thanks. At this point I'll probably work on it tomorrow (I want to work on my own groove :wink: ). I found what I think will be an even easier way to handle single instance. I'll let you know how it goes.

-- Dave
dlmorgan999
HouseBot Special Member
Posts: 409
Joined: Tue Jul 13, 2004 9:13 am
Location: Tigard, OR

Post by dlmorgan999 »

Osler,

The attached ZIP file appears to be handling instance detection correctly. As far as I can tell this should work no matter how the program is started and no matter what OS it's running on. It should also take care of the quote issue. Let me know what you think.

-- Dave

(note: after I posted this I realized that the exe in the Zip file is NOT the current version. I was compiling it directly to the Program Files directory for easier testing. Make sure you compile a new copy before you test it)
Attachments
HBBrowserMutex.zip
(18.37 KiB) Downloaded 796 times
Osler
HouseBot Guru
Posts: 742
Joined: Fri Feb 03, 2006 11:18 pm

Post by Osler »

I got it and am looking at it. I'm not sure I understand the whole mutex thing. The case sensitive string is throwing me....where does this string come from? I'm not seeing where this is generated within the class.

BTW, thanks for the InString....I had forgotten about that one.

Osler
Osler
HouseBot Guru
Posts: 742
Joined: Fri Feb 03, 2006 11:18 pm

Post by Osler »

Ok this works and works well. I sat with the Task Manager open and kept hitting execute program from within HB. At most, a second instance of the browser appears for a split second and then is gone in a flash. Nice work dlmorgan999. The fixes provided by dlmorgan can be found in the latest version:

REMOVED

Osler
Last edited by Osler on Wed Feb 04, 2009 11:11 pm, edited 1 time in total.
Post Reply