There are no errors generated, or problems with the data being returned by
WMI. So far performance is the only issue.
All my WMI calls are like the following:
Dim scope As New ManagementScope("\\" & pcinfo.pcname & "\root\cimv2")
scope.Connect()
Dim query As New SelectQuery("Win32_OperatingSystem")
Dim searcher As new ManagementObjectSearcher(scope, query)
Dim envVar As New ManagementBaseObject
For Each envVar In searcher.Get()
.......
Next
I'm doing most of my testing on a WinXP machine with all the latest hotfixs
from WindowsUpdate. I've also seen the same results running from a Win2k
SP2 Server with all available hotfixes. Some testing I did with VB6 and
it's COM objects showed similar probelms. Does anyone have any ideas what's
causing this behavior, or of possible fixes?
Darren Rice,
dri...@attbi.com
MCSE
In pure scripting, it often helps setting the variables holding interesting
resources to Nothing / null
when they are no more needed, thus taking ownership of the lifetime of
resources.
VB6 uses the same wbemdisp.dll that scripting uses, that is a wrapper on top
of the native interfaces.
Normally in C++ (and native code) is regarded as a bug not calling
IUnknown::Release
on the interface pointers returned by API
(in your case the IWbemServices proxy-manager holds a RPC binding handle,
that holds an RPC connection, that holds a socket, just to make the story
short),
but many layers of P-Code and managed code tend to make people forget about
that.
--
This posting is provided "As Is" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"Darren Rice" <dri...@attbi.com> wrote in message
news:uM17toxSCHA.1880@tkmsftngp13...