Windows Script Components
Posted: Mon Dec 18, 2006 4:48 pm
I think we have all encountered scripts that will crash or hang HouseBot. From my experience, the issue is typically when using a CreateObject call to a specific DLL from within the HouseBot scripting engine....at least this was the case for me when working with the UPnP.dll from Microsoft. Though the typical course would have been to make an ActiveX DLL in Visual Studio, this didn't work either due to issues between VB6 and the DLL. I believe I have found a solution/work-around that anyone proficient with VBScript can use: windows script components. Once created, a component can be registered just like a DLL and called from within a script using the same syntax (Set Foo = CreateObject("Foo.Bar")). It seems that the components are instantiated outside of the HouseBot scripting engine and, thus, are not prone to the calling issues inherent to the HouseBot environment. Properties, Functions, and Events can be set just as if you were creating a Class Object. I have successfully used the UPnP.dll from within HouseBot by using a windows scripting component. This may obviate the need to use the ExecuteProgram Device with cscript/wscript to run certain scripts. By keeping things within HouseBot, it is no longer necessary to use External Control and the limitation on size for list population is minimized.
A primer on WSC can be found here:
http://www.4guysfromrolla.com/webtech/050400-1.shtml
The Windows Script Component Wizard can be found here:
http://www.microsoft.com/downloads/deta ... laylang=en
This should allow for easy creation of "code modules" for use in HouseBot with the benefit of increasing the reliability of scripts run within HouseBot.
Osler
A primer on WSC can be found here:
http://www.4guysfromrolla.com/webtech/050400-1.shtml
The Windows Script Component Wizard can be found here:
http://www.microsoft.com/downloads/deta ... laylang=en
This should allow for easy creation of "code modules" for use in HouseBot with the benefit of increasing the reliability of scripts run within HouseBot.
Osler