Unable to cast COM object of type 'System.__ComObject' to interface

M

mminto

[ERROR MESSAGE:]
Unable to cast COM object of type 'System.__ComObject' to interfac
type 'Manage.Statistics.IManageStats'. This operation failed becaus
the QueryInterface call on the COM component for the interface with II
'{4C2875B5-3265-306B-9C74-1BEC98986B1A}' failed due to the followin
error: Error loading type library/DLL. (Exception from HRESULT
0x80029C4A (TYPE_E_CANTLOADLIBRARY)).

The client is calling a method shown below (exposed by a custom writte
COM+ Application):

dim blnResult as Boolean

dim m_ManageStats as Manage.Statistics.IManageStats = ne
Manage.Statistics.ManageStats

'*** Exception thrown by the following statment ***
blnResult = m_ManageStats.DeleteStatSheetWorkItem(intStatWorkItemID)

NB. The call should flow as shown:
--------------------------------------
[Client App]<-->[Application Proxy]<-->[COM+ Application]<-->[SQ
Server 2000 DBMS]<-->[Database Stored Procedure]

The interfaces etc are summarised below.

N.B. Some of the exposed methods in the same interface below work a
expected.
ALSO The client works fine when calling methods on the same host a
COM+ Application.

Below is the header for the 'ManageStats' COM+ Application

After Building the ManageStats.dll it is installed and registered a
followed:

Regsvcs.exe ManageStats.dll 'Installs and registers the COM
Application called "IPB Business Services"
GacUtil.exe /i ManageStats.dll 'Intalls the assembly in the Globa
Assembly Cache - Doesn't work without this.

<Assembly: ApplicationName("IPB Business Services")>
<Assembly: ApplicationActivation(ActivationOption.Server)>
<Assembly: Description("IPB Business Services - Application Componen
Services")>
<Assembly: AssemblyKeyFileAttribute("sgMStats.snk")>
<Assembly: ApplicationAccessControl(True)>

Namespace Statistics

Public Interface IManageStats

Function DeleteStatSheetWorkItem(ByRef intStatWorkItemID As Short
As Boolean
Function GetWorkItems() As ADODB.Recordset
Function GetSubmittedSheets(ByRef sUserName As String) A
ADODB.Recordset
Function GetWorkItemDetail(ByRef intDailyStatID As Short) A
ADODB.Recordset

End Interface

<ConstructionEnabled( _
[Default]:="DBServer=, Database=, DBUserName=, DBPassword="), _
ComponentAccessControl(True), _
Transaction(TransactionOption.Required)> _
Public Class ManageStats
Inherits ServicedComponent
Implements Statistics.IManageStats

Public Function DeleteStatSheetWorkItem(ByRef intStatWorkItemID A
Short) _
As Boolean _
Implement
Statistics.IManageStats.DeleteStatSheetWorkItem ....
Public Function GetWorkItems() As ADODB.Recordset _
Implement
Statistics.IManageStats.GetWorkItems ....
End Class

End Namespac
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,745
Messages
2,569,485
Members
44,909
Latest member
DestinyKetoScam

Latest Threads

Top