473,386 Members | 1,801 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

WMI Runtime ISSUES

Hi,

The following code works on my machine but when I try to run it on any
other machine I get the error message at the end of this post. Can
anyone please help me, I am slowly losing my Mind ;)
----------------------------------------------------------
Code Snippet
----------------------------------------------------------

Dim mocNetAdapter As Management.ManagementObjectCollection
Dim mocNetAdapterCfg As Management.ManagementObjectCollection
Dim sCaptionNic As String, sCaptionCfg As String
Dim iNic As Integer, iNics As Integer
Dim iCfg As Integer, iCfgs As Integer
Dim aNetAdp() As Management.ManagementObject
Dim aNetCfg() As Management.ManagementObject
mocNetAdapter = New Management.ManagementObjectSearcher(New
Management.SelectQuery("Win32_NetworkAdapter")).Ge t
mocNetAdapterCfg = New
Management.ManagementObjectSearcher(New
Management.SelectQuery("Win32_NetworkAdapterConfig uration")).Get
iNics = mocNetAdapter.Count - 1
iCfgs = mocNetAdapterCfg.Count - 1
ReDim aNetworkAdapter(iNics)
ReDim aNetAdp(iNics)
ReDim aNetCfg(iCfgs)
mocNetAdapter.CopyTo(aNetAdp, 0) ---> Fails Here
mocNetAdapterCfg.CopyTo(aNetCfg, 0)

----------------------------------------------------------
Error Message
----------------------------------------------------------
System.Management.ManagementException: COM object that has been
separated from its underlying RCW can not be used. --->
System.Runtime.InteropServices.InvalidComObjectExc eption: COM object
that has been separated from its underlying RCW can not be used.
at
System.Management.IEnumWbemClassObject.Clone_(IEnu mWbemClassObject&
ppEnum)
at System.Management.ManagementObjectCollection.GetEn umerator()
--- End of inner exception stack trace ---
at
System.Management.ManagementException.ThrowWithExt endedInfo(Exception e)
at System.Management.ManagementObjectCollection.GetEn umerator()
at System.Management.ManagementObjectCollection.CopyT o(Array array,
Int32 index)
at
System.Management.ManagementObjectCollection.CopyT o(ManagementBaseObject
[] objectCollection, Int32 index)
at Assimilator.SDK.clsNICProperties.PopulateNetworkAd apterArray() in
V:\VBNET\Assimilator Ver 4.2\Assimilator.SDK\clsNICProperties.vb:line
674
Thank You
Mark Hollander

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 21 '05 #1
0 932

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Nathan Bloom | last post by:
Hi, I have a secured database that runs fine on the computer the database is installed on. I have several workstations with access runtime installed that also need access to the database. ...
10
by: MLH | last post by:
I am concerned. I have recently moved to A97 from Access 2.0 where I rolled out runtime apps with the ADT. Now, the Office Pro Developer's Edition with Access 97 is what I'm using. I find some...
17
by: Owen Jenkins | last post by:
I have an Access application that is being used by 150+ clients. I develop in 97, convert to 2000 and distribute as a 97 or 2000 mde, or 97 runtime. This limits me to 97 functions. My clients may...
4
by: Sean | last post by:
Hi, I have my application running off my localhost and just transfered it to the production server. And when i ran my application, it came up with a Runtime Error. The server is an IIS and...
3
by: Kevin | last post by:
Wondering what the difference is. As it is I have an application on a share which doesn't run if we install the 2.0 runtime. But when the SDK is installed it works fine. Wondering what kind of...
5
by: RossettoeCioccolato | last post by:
I don't suppose that the redistributable C/C++ runtime library merge module has been packaged into an MSI script and is available for download somewhere? They are bloating up my distribution files...
17
by: Neil | last post by:
A client of mine likes some of the new bells and whistles in Access 2007, and is thinking about converting our A03 format MDB to an A07 format file. However, while some of the users have A07, many...
5
by: florin | last post by:
hi Is there a "simple" way to add attributes to a class/property at runtime? What I try to do is set the default editor for a class/property at runtime (I know I can set this very easy by...
6
by: SMcK | last post by:
I have a PDA-based (Syware Visual CE) database which I need to sync to an Access database. The Access database contains three tables: 1 is the data itself, 2 is a linked table that prefills...
2
by: =?Utf-8?B?TUNN?= | last post by:
I have an UpdatePanel that is throwing the following error on an attempted postback: Sys.WebForms.PagerequestManagerServerErrorException: An Unknown error occurred while processing the request...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.