HighTechTalks DotNet Forums  

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

Dotnet FAQs microsoft.public.dotnet.faqs


Discuss Unable to cast COM object of type 'System.__ComObject' to interface in the Dotnet FAQs forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
mminto
 
Posts: n/a

Default Unable to cast COM object of type 'System.__ComObject' to interface - 01-19-2006 , 10:07 PM







[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(intStatWorkI temID)

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

--
mmint



Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.