473,396 Members | 2,037 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,396 software developers and data experts.

Error with COM + 1.0 Admin Type Library (COMAdmin) interop on Win2K. 2003 works.

I've cross-posted this in the COM+ group as well -
apologies if that's a no-no. But the problem might be
caused by either... interop or just plain COMAdmin.
=============================================

I've got a VB.NET app that is trying to access the
Component Services catalog. The first class method
installs a new component at a specified location. The
second method searches for a specified component and
deletes it.

The reference is to COM + 1.0 Admin Type Library
(COMAdmin)... located in %systemroot%\system32\com\.

The framework version on the 2003 and 2000 servers is
v1.1.4322. The application was developed for that
version (using Visual Studio .NET 2003).

This code works 100% on Windows 2003 server. When trying
to run it on Windows 2000 server, it fails with the
following error:
=START============================================
See the end of this message for details on invoking

just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************

System.InvalidCastException: QueryInterface for interface
COMAdmin.ICOMAdminCatalog2 failed.

at COMAdmin.COMAdminCatalogClass.GetCollection(String
bstrCollName)

at
SecurDOCS_COM_Utility.ComponentServicesManager.Del eteCompo
nent(String componentName, String& applicationName)

at SecurDOCS_COM_Utility.COMUtility.btnReplace_Click
(Object sender, EventArgs e)

at System.Windows.Forms.Control.OnClick(EventArgs e)

at System.Windows.Forms.Button.OnClick(EventArgs e)

at System.Windows.Forms.Button.OnMouseUp(MouseEventAr gs
mevent)

at System.Windows.Forms.Control.WmMouseUp(Message& m,
MouseButtons button, Int32 clicks)

at System.Windows.Forms.Control.WndProc(Message& m)

at System.Windows.Forms.ButtonBase.WndProc(Message& m)

at System.Windows.Forms.Button.WndProc(Message& m)

at System.Windows.Forms.ControlNativeWindow.OnMessage
(Message& m)

at System.Windows.Forms.ControlNativeWindow.WndProc
(Message& m)

at System.Windows.Forms.NativeWindow.Callback(IntPtr
hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
=END==============================================
Here's the class code:

=START============================================ =
Imports COMAdmin

Public Class ComponentServicesManager
Public Sub InstallComponent(ByVal componentName As
String, ByVal applicationName As String)
Dim oCatalog As New COMAdminCatalog

oCatalog.InstallComponent(applicationName,
componentName, Nothing, Nothing)
End Sub

Public Function DeleteComponent(ByVal componentName As
String, ByRef applicationName As String) As Boolean
applicationName = ""
Dim oCatalog As New COMAdminCatalog

' Get the Applications collection and populate it.
Dim oApplications As COMAdminCatalogCollection
oApplications = CType(oCatalog.GetCollection
("Applications"), COMAdminCatalogCollection)
oApplications.Populate()

' Get the correct application
Dim oAppObject As COMAdminCatalogObject

For Each oAppObject In oApplications
' Get and populate the Components collection
Dim oComponents As COMAdminCatalogCollection
oComponents = CType(oApplications.GetCollection
("Components", oAppObject.Key), COMAdminCatalogCollection)
oComponents.Populate()

' Get the correct component
Dim oCompObject As COMAdminCatalogObject
Dim iComponentIndex As Integer = 0

For Each oCompObject In oComponents
Dim sCompDLLValue As String =
oCompObject.Value("DLL").ToString

If sCompDLLValue = componentName Then
applicationName =
oAppObject.Name.ToString
oCatalog.ShutdownApplication
(oAppObject.Name.ToString)
oComponents.Remove(iComponentIndex)
oComponents.SaveChanges()
End If
iComponentIndex += 1
Next

oCompObject = Nothing
Next

If Not applicationName = "" Then
Return True
Else
Return False
End If

oCatalog = Nothing
oApplications = Nothing
oAppObject = Nothing

End Function
End Class

=END==============================================

I need this to work on Windows 2000 server ASAP. Any
ideas what the problem is?

TIA
Jul 21 '05 #1
0 3229

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

Similar topics

3
by: Yitzhak | last post by:
I am having "Permission denied" error while calling LogEvent method of WScript.Shell component. Basically, ASP page calls Windows Script Host Shell component to log events to the OS Application...
0
by: Ola Ogunneye | last post by:
--=_075912CF.F899D547 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Hello again all, I have created an account in the particular database that I was trying to...
2
by: Paul P | last post by:
I am having a problem writing errors to the application log on a Windows 2003 server running IIS 6 The error message is "InvalidOperationException: Cannot open log for source {0}." I have created...
9
by: Ben Dewey | last post by:
Project: ---------------------------- I am creating a HTTPS File Transfer App using ASP.NET and C#. I am utilizing ActiveDirectory and windows security to manage the permissions. Why reinvent...
0
by: dwa | last post by:
I get an "provider load error" at the end of the FMStocks example installtion. After rollback, here's the log: Anyone know what this is about? -- dwa $ Touchup project user options...
7
by: p | last post by:
WE had a Crystal 8 WebApp using vs 2002 which we upgraded to VS2003. I also have Crystal 9 pro on my development machine. The web app runs fine on my dev machine but am having problems deploying....
8
by: Rob Edwards | last post by:
When trying to add the Microsoft CDO for Exchange Management Library (aka CDOEXM.dll) I receive the following message: "A reference to 'Microsoft CDO for Exchange Management Library' could not be...
0
by: MarkD | last post by:
I have an ASP.NET (VB.NET) application that calls all VB6 COM DLL via Interop. The DLL uses functionality contained in a Custom OCX Control (Also VB6) that in turn contains a standard TreeView...
0
by: Grant | last post by:
I've cross-posted this in the COM+ group as well - apologies if that's a no-no. But the problem might be caused by either... interop or just plain COMAdmin....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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?
0
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...
0
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...
0
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...
0
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.