the same here, the second one doesn't work here.SFSxOI wrote:Kiffi;
It was a nice example, however, the first 'COMate' one worked fine, the second 'VBS' one doesn't work, at least not here. Just a blank window.
COMate - control COM objects via automation - OBSOLETE!
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.

Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.

@SFSxOI & Thomas,
try to insert the following Repeat-Forever-Loop for waiting until the
webgadget is not busy anymore:
Greetings ... Kiffi
try to insert the following Repeat-Forever-Loop for waiting until the
webgadget is not busy anymore:
Code: Select all
[...]
WebGadget(0, 10, 10, 580, 280, "about:blank")
Repeat
If GetGadgetAttribute(0, #PB_Web_Busy) = 0
Break
EndIf
While WindowEvent(): Delay(1) : Wend
ForEver
SetGadgetItemText(0, #PB_Web_HtmlCode, ExecuteVbs())
[...]
Hygge
> @SFSxOI & Thomas: Could you test again?
yesterday without problems
yesterday without problems

PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.

Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.

Yep, works here now
Thanks
On a sort of related item for something else actually but related for me to this....
how do you set a parameter for a method that includes an 'and' that looks like this:
where Search is the method
?

On a sort of related item for something else actually but related for me to this....
how do you set a parameter for a method that includes an 'and' that looks like this:
Code: Select all
updateSearcher.Search("IsInstalled=1 and Type='Software'")
?
Surely it is just a single string parameter?
Perhaps...
Perhaps...
Code: Select all
updateSearche\Invoke("Search('IsInstalled=1 and Type=$0027Software$0027'")
I may look like a mule, but I'm not a complete ass.
Search is a function, not a method.SFSxOI wrote:where Search is the method
Code: Select all
Set SearchResult = UpdateSearcher.Search("...
Greetings ... Kiffi
Hygge
http://msdn.microsoft.com/en-us/library ... S.85).aspx
says its a method. Is it really a function? Would not be the first time the MSDN was misleading in some way or i've misunderstood it.
It says this for the Search ;
"With some restrictions, multiple criteria can be connected with the AND and OR operators. "
and
" A single criterion consists of "Name = Value" or "Name != Value", where "Name" is one of the supported criterion names, and "Value" is a string or an integer. The AND and OR operators can be used to connect multiple criteria. However, OR can be used only at the top level of the search criteria. Therefore, "(x=1 and y=1) or (z=1)" is valid, but "(x=1) and (y=1 or z=1)" is not valid."
and every example i can find for it has it formatted as "updateSearcher.Search("IsInstalled=1 and Type='Software'") " ( or...."updateSearcher.Search("IsInstalled=0 and Type='Software'") " ) with two criterion so I think that it has two criterion.
so, combining srod's example from above and what you presented it looks like this then?
says its a method. Is it really a function? Would not be the first time the MSDN was misleading in some way or i've misunderstood it.
It says this for the Search ;
"With some restrictions, multiple criteria can be connected with the AND and OR operators. "
and
" A single criterion consists of "Name = Value" or "Name != Value", where "Name" is one of the supported criterion names, and "Value" is a string or an integer. The AND and OR operators can be used to connect multiple criteria. However, OR can be used only at the top level of the search criteria. Therefore, "(x=1 and y=1) or (z=1)" is valid, but "(x=1) and (y=1 or z=1)" is not valid."
and every example i can find for it has it formatted as "updateSearcher.Search("IsInstalled=1 and Type='Software'") " ( or...."updateSearcher.Search("IsInstalled=0 and Type='Software'") " ) with two criterion so I think that it has two criterion.
so, combining srod's example from above and what you presented it looks like this then?
Code: Select all
UpdateSearcher\GetObjectProperty("Search('IsInstalled=1 and Type=$0027Software$0027'")")
or this:
UpdateSearcher\Invoke("Search('IsInstalled=1 and Type=$0027Software$0027'")")
perhaps my english is to bad, but let me explain in this way:SFSxOI wrote:says its a method. Is it really a function? Would not be the first time the MSDN was incorrect or misleading in some way.
this method has an out-Parameter, so in COMate you have to handle Search() like a function.
the result of Search() must returned somewhere.MSDN wrote:[out] ISearchResult **retval
rather something like this:SFSxOI wrote:so, combining srod's example from above and what you presented it looks like this then?
Code: Select all
UpdateSearcher\GetObjectProperty("Search('IsInstalled=1 and Type=$0027Software$0027'")")
Code: Select all
SearchResult.COMateObject = UpdateSearcher\GetObjectProperty("Search('IsInstalled=1 and Type=$0027Software$0027')")
Hygge
When using COMate, any parameters listed as being an 'out' parameter are handled automatically. If you see an 'out' parameter listed in a method's parameter list then you should use one of COMate's Get...Property() calls and it will retrieve the aforementioned value.
You will not ordinarily need to worry about dealing with these 'out' parameters yourself - unless a method lists two or more such parameters!
You will not ordinarily need to worry about dealing with these 'out' parameters yourself - unless a method lists two or more such parameters!

I may look like a mule, but I'm not a complete ass.
Thanks srod 
anyway, what i'm working on is an automated update thing for a project we have comming up this summer. Each summer our company lends its personnel, time, and equipment, to the support of a summer camp for under privilaged children. Part of this camp experience for them includes an introduction to computers and their use. We supply approximately 150 computers each year, all state of the art, for the kids and the staff to use. We get the majority of these from coporation donations and they are brand new except most of them don't come with an operating system installed yet so we have to do that. Last year I used PureBasic to build some automated things that ran during the OS install for setting things up for networking and so on, it worked out great. But this year its a little different. Last year we were able to set up on site and network them all together and do everything at once across the network, this year we will not be able to do that in advanced for most of the machines due to some constraints so when they arrive on site they will have to be ready to plug in and use. One of the things that was missing though was updates to the operating system which meant that we had to visit each machine individually and start the updates. This year we plan to just be able to download and install the updates automatically via a setup in taskmanager to run an update utility which will get, download, and install updates from windows update without any human intervention, and thats what i'm working on now. So far i'm identifying the updates already on the machine (actually some get installed with the automated OS install sequence but the ones from windows update don't), so thats what this code is so far (this is just the windows update portion):
<code removed - it wasn't working - working version posted later in thread two posts from this one>
Still gotta check it out to make sure it works. I haven't started on the download, identifying which ones to install, and install routines yet. yeah, I know there are .vbs scripts to do this but i wanna do it in Purebasic like i did the past stuff.

anyway, what i'm working on is an automated update thing for a project we have comming up this summer. Each summer our company lends its personnel, time, and equipment, to the support of a summer camp for under privilaged children. Part of this camp experience for them includes an introduction to computers and their use. We supply approximately 150 computers each year, all state of the art, for the kids and the staff to use. We get the majority of these from coporation donations and they are brand new except most of them don't come with an operating system installed yet so we have to do that. Last year I used PureBasic to build some automated things that ran during the OS install for setting things up for networking and so on, it worked out great. But this year its a little different. Last year we were able to set up on site and network them all together and do everything at once across the network, this year we will not be able to do that in advanced for most of the machines due to some constraints so when they arrive on site they will have to be ready to plug in and use. One of the things that was missing though was updates to the operating system which meant that we had to visit each machine individually and start the updates. This year we plan to just be able to download and install the updates automatically via a setup in taskmanager to run an update utility which will get, download, and install updates from windows update without any human intervention, and thats what i'm working on now. So far i'm identifying the updates already on the machine (actually some get installed with the automated OS install sequence but the ones from windows update don't), so thats what this code is so far (this is just the windows update portion):
<code removed - it wasn't working - working version posted later in thread two posts from this one>
Still gotta check it out to make sure it works. I haven't started on the download, identifying which ones to install, and install routines yet. yeah, I know there are .vbs scripts to do this but i wanna do it in Purebasic like i did the past stuff.
Last edited by SFSxOI on Wed Mar 11, 2009 12:01 am, edited 4 times in total.