473,806 Members | 2,735 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Management Issues

I get the following error with the class below it when installing on a
NT/98/Me machine. Any suggestions would be helpful. Kind of in a bind.
Suspect the issue revolves
System.Runtime. InteropServices .COMException (0x80040154): COM object with
CLSID {4590F811-1D3A-11D0-891F-00AA004B2E24} is either not valid or not
registered.
at System.Manageme nt.ManagementSc ope.Initialize( )
at System.Manageme nt.ManagementOb jectSearcher.In itialize()
at System.Manageme nt.ManagementOb jectSearcher.Ge t()
at Computer_Inform ation.clsWMI..c tor()
at Computer_Inform ation.Form1.But ton1_Click(Obje ct sender, EventArgs e)
at System.Windows. Forms.Control.O nClick(EventArg s e)
at System.Windows. Forms.Button.On Click(EventArgs e)
at System.Windows. Forms.Button.On MouseUp(MouseEv entArgs mevent)
at System.Windows. Forms.Control.W mMouseUp(Messag e& m, MouseButtons
button, Int32 clicks)
at System.Windows. Forms.Control.W ndProc(Message& m)
at System.Windows. Forms.ButtonBas e.WndProc(Messa ge& m)
at System.Windows. Forms.Button.Wn dProc(Message& m)
at System.Windows. Forms.ControlNa tiveWindow.OnMe ssage(Message& m)
at System.Windows. Forms.ControlNa tiveWindow.WndP roc(Message& m)
at System.Windows. Forms.NativeWin dow.Callback(In tPtr hWnd, Int32 msg,
IntPtr wparam, IntPtr lparam)
System.Runtime. InteropServices .COMException (0x80040154): COM object with
CLSID {4590F811-1D3A-11D0-891F-00AA004B2E24} is either not valid or not
registered.
at System.Manageme nt.ManagementSc ope.Initialize( )
at System.Manageme nt.ManagementOb jectSearcher.In itialize()
at System.Manageme nt.ManagementOb jectSearcher.Ge t()
at Computer_Inform ation.clsWMI..c tor()
at Computer_Inform ation.Form1.But ton1_Click(Obje ct sender, EventArgs e)
at System.Windows. Forms.Control.O nClick(EventArg s e)
at System.Windows. Forms.Button.On Click(EventArgs e)
at System.Windows. Forms.Button.On MouseUp(MouseEv entArgs mevent)
at System.Windows. Forms.Control.W mMouseUp(Messag e& m, MouseButtons
button, Int32 clicks)
at System.Windows. Forms.Control.W ndProc(Message& m)
at System.Windows. Forms.ButtonBas e.WndProc(Messa ge& m)
at System.Windows. Forms.Button.Wn dProc(Message& m)
at System.Windows. Forms.ControlNa tiveWindow.OnMe ssage(Message& m)
at System.Windows. Forms.ControlNa tiveWindow.WndP roc(Message& m)
at System.Windows. Forms.NativeWin dow.Callback(In tPtr hWnd, Int32 msg,
IntPtr wparam, IntPtr lparam)

Imports System.Manageme nt

Public Class clsWMI
Private objOS As ManagementObjec tSearcher
Private objCS As ManagementObjec tSearcher
Private objMgmt As ManagementObjec t
Private m_strComputerNa me As String
Private m_strManufactur er As String
Private m_StrModel As String
Private m_strOSName As String
Private m_strOSVersion As String
Private m_strSystemType As String
Private m_strTPM As String
Private m_strWindowsDir As String
Public Sub New()

objOS = New ManagementObjec tSearcher("SELE CT * FROM
Win32_Operating System")
objCS = New ManagementObjec tSearcher("SELE CT * FROM
Win32_ComputerS ystem")
For Each objMgmt In objOS.Get
m_strOSName = objMgmt("name") .ToString()
m_strOSVersion = objMgmt("versio n").ToString ()
m_strComputerNa me = objMgmt("csname ").ToString ()
m_strWindowsDir = objMgmt("window sdirectory").To String()
Next

For Each objMgmt In objCS.Get
m_strManufactur er = objMgmt("manufa cturer").ToStri ng()
m_StrModel = objMgmt("model" ).ToString()
m_strSystemType = objMgmt("system type").ToString
m_strTPM = objMgmt("totalp hysicalmemory") .ToString()
Next
End Sub

Public ReadOnly Property ComputerName()
Get
ComputerName = m_strComputerNa me
End Get

End Property
Public ReadOnly Property Manufacturer()
Get
Manufacturer = m_strManufactur er
End Get

End Property
Public ReadOnly Property Model()
Get
Model = m_StrModel
End Get

End Property
Public ReadOnly Property OsName()
Get
OsName = m_strOSName
End Get

End Property

Public ReadOnly Property OSVersion()
Get
OSVersion = m_strOSVersion
End Get

End Property
Public ReadOnly Property SystemType()
Get
SystemType = m_strSystemType
End Get

End Property
Public ReadOnly Property TotalPhysicalMe mory()
Get
TotalPhysicalMe mory = m_strTPM
End Get

End Property

Public ReadOnly Property WindowsDirector y()
Get
WindowsDirector y = m_strWindowsDir
End Get

End Property

End Class


Nov 20 '05 #1
7 1527
Hi,

Make sure WMI is not installed on Win NT4, 95, or 98. Here is the
redist.
http://www.microsoft.com/downloads/d...DisplayLang=en

Auto start WMI on 95/98
http://msdn.microsoft.com/library/de...dows_95_98.asp

Ken
------------
"scorpion53 061" <Its the end of the world as we know it@here.com> wrote in
message news:e3******** ******@TK2MSFTN GP11.phx.gbl...
I get the following error with the class below it when installing on a
NT/98/Me machine. Any suggestions would be helpful. Kind of in a bind.
Suspect the issue revolves
System.Runtime. InteropServices .COMException (0x80040154): COM object with
CLSID {4590F811-1D3A-11D0-891F-00AA004B2E24} is either not valid or not
registered.
at System.Manageme nt.ManagementSc ope.Initialize( )
at System.Manageme nt.ManagementOb jectSearcher.In itialize()
at System.Manageme nt.ManagementOb jectSearcher.Ge t()
at Computer_Inform ation.clsWMI..c tor()
at Computer_Inform ation.Form1.But ton1_Click(Obje ct sender, EventArgs e)
at System.Windows. Forms.Control.O nClick(EventArg s e)
at System.Windows. Forms.Button.On Click(EventArgs e)
at System.Windows. Forms.Button.On MouseUp(MouseEv entArgs mevent)
at System.Windows. Forms.Control.W mMouseUp(Messag e& m, MouseButtons
button, Int32 clicks)
at System.Windows. Forms.Control.W ndProc(Message& m)
at System.Windows. Forms.ButtonBas e.WndProc(Messa ge& m)
at System.Windows. Forms.Button.Wn dProc(Message& m)
at System.Windows. Forms.ControlNa tiveWindow.OnMe ssage(Message& m)
at System.Windows. Forms.ControlNa tiveWindow.WndP roc(Message& m)
at System.Windows. Forms.NativeWin dow.Callback(In tPtr hWnd, Int32 msg,
IntPtr wparam, IntPtr lparam)
System.Runtime. InteropServices .COMException (0x80040154): COM object with
CLSID {4590F811-1D3A-11D0-891F-00AA004B2E24} is either not valid or not
registered.
at System.Manageme nt.ManagementSc ope.Initialize( )
at System.Manageme nt.ManagementOb jectSearcher.In itialize()
at System.Manageme nt.ManagementOb jectSearcher.Ge t()
at Computer_Inform ation.clsWMI..c tor()
at Computer_Inform ation.Form1.But ton1_Click(Obje ct sender, EventArgs e)
at System.Windows. Forms.Control.O nClick(EventArg s e)
at System.Windows. Forms.Button.On Click(EventArgs e)
at System.Windows. Forms.Button.On MouseUp(MouseEv entArgs mevent)
at System.Windows. Forms.Control.W mMouseUp(Messag e& m, MouseButtons
button, Int32 clicks)
at System.Windows. Forms.Control.W ndProc(Message& m)
at System.Windows. Forms.ButtonBas e.WndProc(Messa ge& m)
at System.Windows. Forms.Button.Wn dProc(Message& m)
at System.Windows. Forms.ControlNa tiveWindow.OnMe ssage(Message& m)
at System.Windows. Forms.ControlNa tiveWindow.WndP roc(Message& m)
at System.Windows. Forms.NativeWin dow.Callback(In tPtr hWnd, Int32 msg,
IntPtr wparam, IntPtr lparam)

Imports System.Manageme nt

Public Class clsWMI
Private objOS As ManagementObjec tSearcher
Private objCS As ManagementObjec tSearcher
Private objMgmt As ManagementObjec t
Private m_strComputerNa me As String
Private m_strManufactur er As String
Private m_StrModel As String
Private m_strOSName As String
Private m_strOSVersion As String
Private m_strSystemType As String
Private m_strTPM As String
Private m_strWindowsDir As String
Public Sub New()

objOS = New ManagementObjec tSearcher("SELE CT * FROM
Win32_Operating System")
objCS = New ManagementObjec tSearcher("SELE CT * FROM
Win32_ComputerS ystem")
For Each objMgmt In objOS.Get
m_strOSName = objMgmt("name") .ToString()
m_strOSVersion = objMgmt("versio n").ToString ()
m_strComputerNa me = objMgmt("csname ").ToString ()
m_strWindowsDir = objMgmt("window sdirectory").To String()
Next

For Each objMgmt In objCS.Get
m_strManufactur er = objMgmt("manufa cturer").ToStri ng()
m_StrModel = objMgmt("model" ).ToString()
m_strSystemType = objMgmt("system type").ToString
m_strTPM = objMgmt("totalp hysicalmemory") .ToString()
Next
End Sub

Public ReadOnly Property ComputerName()
Get
ComputerName = m_strComputerNa me
End Get

End Property
Public ReadOnly Property Manufacturer()
Get
Manufacturer = m_strManufactur er
End Get

End Property
Public ReadOnly Property Model()
Get
Model = m_StrModel
End Get

End Property
Public ReadOnly Property OsName()
Get
OsName = m_strOSName
End Get

End Property

Public ReadOnly Property OSVersion()
Get
OSVersion = m_strOSVersion
End Get

End Property
Public ReadOnly Property SystemType()
Get
SystemType = m_strSystemType
End Get

End Property
Public ReadOnly Property TotalPhysicalMe mory()
Get
TotalPhysicalMe mory = m_strTPM
End Get

End Property

Public ReadOnly Property WindowsDirector y()
Get
WindowsDirector y = m_strWindowsDir
End Get

End Property

End Class

Nov 20 '05 #2
> Make sure WMI is not installed on Win NT4, 95, or 98.

HI Ken,

this was good and I thank you.

After installing this the exception is thrown that this class is not set to
an instance of an object. DO you have any ideas on why this might be? Is
there anythng you need to see to make that determination?


Nov 20 '05 #3
Hi,

Try something like this. Maybe you can find the error.
Public Sub New()

Try

objOS = New ManagementObjec tSearcher("SELE CT * FROM Win32_Operating System")

For Each objMgmt In objOS.Get

m_strOSName = objMgmt("name") .ToString()

m_strOSVersion = objMgmt("versio n").ToString ()

m_strComputerNa me = objMgmt("csname ").ToString ()

m_strWindowsDir = objMgmt("window sdirectory").To String()

Next

Catch

MessageBox.Show ("Error with Win32_Operating System")

End Try

Try

objCS = New ManagementObjec tSearcher("SELE CT * FROM Win32_ComputerS ystem")

For Each objMgmt In objCS.Get

m_strManufactur er = objMgmt("manufa cturer").ToStri ng()

m_StrModel = objMgmt("model" ).ToString()

m_strSystemType = objMgmt("system type").ToString

m_strTPM = objMgmt("totalp hysicalmemory") .ToString()

Next

Catch

MessageBox.Show ("Error with Win32_ComputerS ystem")

End Try

End Sub
Ken
----------------
"scorpion53 061" <Its the end of the world as we know it@here.com> wrote in
message news:ey******** *****@TK2MSFTNG P10.phx.gbl...
Make sure WMI is not installed on Win NT4, 95, or 98.


HI Ken,

this was good and I thank you.

After installing this the exception is thrown that this class is not set
to
an instance of an object. DO you have any ideas on why this might be? Is
there anythng you need to see to make that determination?

Nov 20 '05 #4
* "scorpion53 061" <Its the end of the world as we know it@here.com> scripsit:
I get the following error with the class below it when installing on a
NT/98/Me machine. Any suggestions would be helpful. Kind of in a bind.
Suspect the issue revolves


In addition to the other replies: Notice that there is a separate group
available for .NET + WMI:

news:microsoft. public.dotnet.f ramework.wmi

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #5
> Try something like this. Maybe you can find the error.

Everything is fine on 2000 and XP. It is only on 98 and Me that are drawing
the issues.

No more information is given than this on 98 and Me.

Any more thoughts?
Thank you for yoru help.
Nov 20 '05 #6
> Try something like this. Maybe you can find the error.

Hi Ken,

Using your suggestion I found where it is choking on WIN98 and WIN Me. Also
using that registry key I specified early returned as empty on the WIN ME
machine I tried it on.
Nov 20 '05 #7
If you are using any 3rd party controls, make sure they are flagged as
vsdrfCOMSelfReg on your deployment. This is found as the Register
property of each file being installed.

"scorpion53 061" <Its the end of the world as we know it@here.com> wrote in message news:<e3******* *******@TK2MSFT NGP11.phx.gbl>. ..
I get the following error with the class below it when installing on a
NT/98/Me machine. Any suggestions would be helpful. Kind of in a bind.
Suspect the issue revolves
System.Runtime. InteropServices .COMException (0x80040154): COM object with
CLSID {4590F811-1D3A-11D0-891F-00AA004B2E24} is either not valid or not
registered.
at System.Manageme nt.ManagementSc ope.Initialize( )
at System.Manageme nt.ManagementOb jectSearcher.In itialize()
at System.Manageme nt.ManagementOb jectSearcher.Ge t()
at Computer_Inform ation.clsWMI..c tor()
at Computer_Inform ation.Form1.But ton1_Click(Obje ct sender, EventArgs e)
at System.Windows. Forms.Control.O nClick(EventArg s e)
at System.Windows. Forms.Button.On Click(EventArgs e)
at System.Windows. Forms.Button.On MouseUp(MouseEv entArgs mevent)
at System.Windows. Forms.Control.W mMouseUp(Messag e& m, MouseButtons
button, Int32 clicks)
at System.Windows. Forms.Control.W ndProc(Message& m)
at System.Windows. Forms.ButtonBas e.WndProc(Messa ge& m)
at System.Windows. Forms.Button.Wn dProc(Message& m)
at System.Windows. Forms.ControlNa tiveWindow.OnMe ssage(Message& m)
at System.Windows. Forms.ControlNa tiveWindow.WndP roc(Message& m)
at System.Windows. Forms.NativeWin dow.Callback(In tPtr hWnd, Int32 msg,
IntPtr wparam, IntPtr lparam)
System.Runtime. InteropServices .COMException (0x80040154): COM object with
CLSID {4590F811-1D3A-11D0-891F-00AA004B2E24} is either not valid or not
registered.
at System.Manageme nt.ManagementSc ope.Initialize( )
at System.Manageme nt.ManagementOb jectSearcher.In itialize()
at System.Manageme nt.ManagementOb jectSearcher.Ge t()
at Computer_Inform ation.clsWMI..c tor()
at Computer_Inform ation.Form1.But ton1_Click(Obje ct sender, EventArgs e)
at System.Windows. Forms.Control.O nClick(EventArg s e)
at System.Windows. Forms.Button.On Click(EventArgs e)
at System.Windows. Forms.Button.On MouseUp(MouseEv entArgs mevent)
at System.Windows. Forms.Control.W mMouseUp(Messag e& m, MouseButtons
button, Int32 clicks)
at System.Windows. Forms.Control.W ndProc(Message& m)
at System.Windows. Forms.ButtonBas e.WndProc(Messa ge& m)
at System.Windows. Forms.Button.Wn dProc(Message& m)
at System.Windows. Forms.ControlNa tiveWindow.OnMe ssage(Message& m)
at System.Windows. Forms.ControlNa tiveWindow.WndP roc(Message& m)
at System.Windows. Forms.NativeWin dow.Callback(In tPtr hWnd, Int32 msg,
IntPtr wparam, IntPtr lparam)

Imports System.Manageme nt

Public Class clsWMI
Private objOS As ManagementObjec tSearcher
Private objCS As ManagementObjec tSearcher
Private objMgmt As ManagementObjec t
Private m_strComputerNa me As String
Private m_strManufactur er As String
Private m_StrModel As String
Private m_strOSName As String
Private m_strOSVersion As String
Private m_strSystemType As String
Private m_strTPM As String
Private m_strWindowsDir As String
Public Sub New()

objOS = New ManagementObjec tSearcher("SELE CT * FROM
Win32_Operating System")
objCS = New ManagementObjec tSearcher("SELE CT * FROM
Win32_ComputerS ystem")
For Each objMgmt In objOS.Get
m_strOSName = objMgmt("name") .ToString()
m_strOSVersion = objMgmt("versio n").ToString ()
m_strComputerNa me = objMgmt("csname ").ToString ()
m_strWindowsDir = objMgmt("window sdirectory").To String()
Next

For Each objMgmt In objCS.Get
m_strManufactur er = objMgmt("manufa cturer").ToStri ng()
m_StrModel = objMgmt("model" ).ToString()
m_strSystemType = objMgmt("system type").ToString
m_strTPM = objMgmt("totalp hysicalmemory") .ToString()
Next
End Sub

Public ReadOnly Property ComputerName()
Get
ComputerName = m_strComputerNa me
End Get

End Property
Public ReadOnly Property Manufacturer()
Get
Manufacturer = m_strManufactur er
End Get

End Property
Public ReadOnly Property Model()
Get
Model = m_StrModel
End Get

End Property
Public ReadOnly Property OsName()
Get
OsName = m_strOSName
End Get

End Property

Public ReadOnly Property OSVersion()
Get
OSVersion = m_strOSVersion
End Get

End Property
Public ReadOnly Property SystemType()
Get
SystemType = m_strSystemType
End Get

End Property
Public ReadOnly Property TotalPhysicalMe mory()
Get
TotalPhysicalMe mory = m_strTPM
End Get

End Property

Public ReadOnly Property WindowsDirector y()
Get
WindowsDirector y = m_strWindowsDir
End Get

End Property

End Class

Nov 20 '05 #8

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

Similar topics

3
5121
by: Marcelo A. Camelo | last post by:
Hi! I will be presenting Python to an audience of game developers, mostly C/C++ programmers. In my presentation I will talk about using python and C/C++ extension instead of pure C/C++ to write commercial games and content creation tools. In a number of times I have presented these ideas to this same kind of audience and they were received with cold skepticism, despite the fact that some, including me, are already doing this with...
0
2146
by: Scott Abel | last post by:
For immediate release: The Rockley Group Content Management Workshop Series Coming to Atlanta, Seattle, Vancouver, Chicago, Washington, DC, Toronto, and Research Triangle Park Learn more: http://www.rockley.com/workshops.htm The Rockley Group Content Management Workshop Series is designed to
1
1856
by: Abelardo Vacca | last post by:
Hello, I am currently in the process of switching our application to a N-Tier model with .NET. One of the aspects we want ot get right from the start not to worry about it after is the Exception management. I have read two MSDN documents that appear to be in contradiction, and I would like to know if someone can explain to me which of the two is the
1
1858
by: Mark F. Haigh | last post by:
In Andrei Alexandrescu's book _Modern C++ Design_, Chapter 8 ("Object Factories"), Section 8.4 ("Type Identifiers"), he states: The only problem that remains is the management of type identifiers. Still, adding type identifiers requires a fair amount of dicipline and centralized control. The only conclusion that can be drawn here is that type identifier management is not the business of the object factory itself.
2
1431
by: geodev | last post by:
Hello, I’m currently writing an asp.net application that will be running on a Windows XP Professional workstation utilising IIS and MSDE Database. At a later date this application will need to run on a Windows Server 2003 IIS web farm utilising either MSDE Database or SQL Server Database. I’m developing this application utilising Microsoft’s Development Environment 2002 version.
5
2687
by: RobbGMelenyk | last post by:
I've got a Windows Service written in C# that is having some unfortunate memory issues. I've been working with .NET MemProfiler and AllocationProfiler. But you don't have to use those programs to notice the memory leak. The memory usage in the TaskManager for the process can be seen climbing and climbing, MBs at a time. When using MemProfiler, I noticed the Win32 Heap is what seems to be growing. I've been searching on the internet...
0
1999
by: Scott Abel | last post by:
Tuesday, December 12, 2006 -- 10:00AM EST / 3:00 PM GMT X-Pubs presents: CMS & Change - Love it, Hate it, Master it (Scott Abel & Emma Hamer) Reserve your Webinar seat now at: https://www.gotomeeting.com/register/952419737 In this interactive online event, you the participants, and content management strategist Scott Abel, will be interviewing Career and
10
3166
by: Henrik Dahl | last post by:
Hello! I have some images (for instance in .jpg files) which I would like to apply digital rights management for, i.e. that only authorized users may wiew then using their www browser, i.e. if a non-authorized user is attempting to address the .jpg file with a url, or for that sake gets a copy of the image file from an authorized user, the un-authorized user should not be able to view the image. Does some of the .NET or other...
0
9719
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9599
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10371
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10374
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10111
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9193
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5684
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4330
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3853
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.