Page 4 of 12

Posted: Fri Jan 26, 2007 10:38 pm
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

Posted: Fri Jan 26, 2007 10:51 pm
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

Posted: Sat Jan 27, 2007 12:28 am
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

Posted: Sat Jan 27, 2007 10:33 am
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

Posted: Sat Jan 27, 2007 11:11 am
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

Posted: Sat Jan 27, 2007 11:33 am
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

Posted: Sat Jan 27, 2007 11:44 am
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

Posted: Sat Jan 27, 2007 6:22 pm
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

Posted: Sat Jan 27, 2007 7:06 pm
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

Posted: Sat Jan 27, 2007 8:10 pm
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

Posted: Sat Jan 27, 2007 8:19 pm
by Osler
Uploaded from "the groove":

REMOVED

Osler

Posted: Sat Jan 27, 2007 9:01 pm
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

Posted: Sun Jan 28, 2007 1:27 am
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)

Posted: Sun Jan 28, 2007 8:09 pm
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

Posted: Sun Jan 28, 2007 8:24 pm
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