Hello,
Please can someone assist me with the following issue that I have with COM Interoperability. I am using the new .NET 2.0 Framework.
I have created a production capture web application which allows our operation staff to capture production into our ERP system through a web interface which is quick and provides all the necessary data verification. I access the PROTEAN ERP environment using the system API’s which is a collection of DLL’s.
I started by convert the C+ DLL’s into .NET DLLs using the Type Library Importer (Tlbimp.exe) and then copied the file into the BIN directory of my web application and made a reference to the DLL from VS. The converted file is called NETProtean. I create a simple class called Protean Wrapper which when instantiated creates an object of the convert COM object. The class has so far one function which utilizes the logon function provided by the COM object.
The class looks like the following:
Imports Microsoft.VisualBasic
Imports System.Runtime.InteropServices
Imports NetProtean
Public Class ProteanWrapper
Dim mysession As CProteanSession
Public Sub New()
mysession = New CProteanSession()
End Sub
Function Logon(ByVal txtusername As String, ByVal txtpassword As String, ByVal txtdatabase As String) As Boolean
Dim login As Boolean
login = mysession.Login(txtusername, txtpassword, txtdatabase)
Return mysession.IsConnected
End Function
End Class
I then created another a web page which instantiates the ProteanWrapper class and uses the logon function to logon to the PROTEAN ERP environment which works perfectly
Web page code below:
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim mysession As New ProteanWrapper
lblConnected.Text = mysession.Logon("servicescbsa", "servicescbsa", "dbPZACTxxLIVE")
End Sub
So far I do not have a problem and everything works perfectly. However, after a certain amount of idle time, the Protean session process located in the Windows task manager disappears. This represents the connection to the ERP environment. When this Process disappears and I rerun the web page I get the following error:
Creating an instance of the COM component with CLSID {5FBD2514-9C00-11D1-BBBE-0000C091D9DB} from the IClassFactory failed due to the following error: 80010105.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Runtime.InteropServices.COMException: Creating an instance of the COM component with CLSID {5FBD2514-9C00-11D1-BBBE-0000C091D9DB} from the IClassFactory failed due to the following error: 80010105.
Source Error:
Line 20: Public Sub New()Line 21: Line 22: mysession = New CProteanSession()Line 23: Line 24: End Sub |
Source File: C:\Inetpub\wwwroot\ScheduleCapture2\App_Code\ProteanWrapper.vb Line: 22
I have two questions:
1) Why does the Protean Session process located in the Windows task manager of the web server (which represents my connection to Protean) disappear after a certain period of idle time Is this done by .NET’s garbage collection
2) What exactly does this message mean to me
3) How can I fix this from occurring
Regards,
Stuart Ormiston
Business Analyst
Coates Brothers
Tel: +27 21 590 5145

Creating an instance of the COM component with CLSID
bobwilmes
jnousis
Hello Nikhil,
Thank you for your quick response. The application log has collected information about the process and i have noticed this error together with a few others located in there. I think one of the other error messages is associated with the CProteanSession process. Let me investigate and i will post my findings.
Thanks again for the assistance.
Regards,
Stuart.
cookiekhanh
1) The process disappears as it has finished processing. This could be because it encountered an error. Hopefully the process has some logging that can assist in finding out what happened. The GC doesnt kill processes.
However your class ProteanWrapper should at some stage release the COM object mySession using the Marshal.ReleaseCOMObject(mysession).
2) It means that the component creation failed. 80010105 == Unknown OLE Error. Its possible that the component on creation tries to communicate with that process which is terminating. Failure in this may have caused the above error.
3) You need to find out why the process is terminating by looking at some logs (Event Log, flat file logs,application documentation etc). You also need to understand the relationship between the COM component (CProteanSession) and the process.