Lots of people have discussions about COM interop and I have read them all already.
Case 1: VB 6 or VBA needs to consume libraries in .NET ( I have FileNet objects, IBM already created a COM wrapper DLL which can be consumed by VBA
Case 2: Your .NET source code needs to consume a COM/COM+ object class, that is Not my case.
So my case is Case 1. I don't have to deal with generics ( see Genetics and COM interop don't Mix, the article use reflection to solve the issue, but is very slow. Now with C# 4.0 dynamic is the way to go (100x faster) http://www.west-wind.com/weblog/posts/2007/Jul/10/Generics-and-COM-Interop-dont-mix )
Why do I need to write another wrapper? because IBM document said ADOConnection is not supported due to .NET library's limitation. and also another function is Not available (it used to be available in previous version so my ASP calls it) so I have to generate my own.
Function FilterClassDescriptions(ByVal ObjType As Variant, Optional FilterType As Variant) As Variant
FileNet's wrapper COM DLL consumes FNCE's class which was compiled into .NET DLL. Since .NET don't support ADOConnection, obviously some functions doesn't support anymore. but my ASP rely on those functions. FNCE => FileNet Content Engine.
so I created a wrapper VB6 class around the COM compatibility layer DLL, and I tried registering both active DLL and active EXE, but in VBA for Excel I didn't createObject(myFNCE2013) successfully (means I don't contents of the object), I did get creteObject(FNCE) correctly because I can see stuff in ObjectStore. So what went wrong?
My question is wrapper after wrapper is bad?? or because I previously registered the same active EXE/DLL causing problem? I used double click method to register, and first time I saw registered successfully. I have Windows 2003 server with SP2, IIS running for my ASP.
Here is IBM's description about it.
Content Engine Methods Not Supported
New methods added by Content Engine 4.x to objects supported by the COM Compatibility Layer are not exposed in the COM Compatibility Layer.
Methods supported by the COM API but not by the Content Engine 4.x API are exposed in the COM Compatibility Layer interfaces, but attempting to call these methods will return a "Not supported" error. The following is a list of these methods:
If your existing code uses either of these ObjectStore properties, you must write your own filtering logic based on iterating through the ObjectStore.ClassDescriptions collection or using ObjectStore.GetObject("ClassDescription", "").
Here is my debug info.
Thankf for reading up to here. I have an ugly solution but I still want to hear your smart solution. My ugly duckly is: Don't write wrapper VB6 class anymore, put the code into ASP include file so ASP page can consume those functions, but then I don't have VB class because ASP include file doesn't allow that. Those include files should be able to call COM object directly. But breaking class object into non-OOP functional code? We got so cozy thinking with class objects, non-OOP programming seems rustic to me.
Private oEntireNetwork As FNCE.EntireNetwork Private oObjectStore As FNCE.ObjectStore Private oUser As FNCE.user Private sObjectStoreName As String Private oDocument As FNCE.Document Private sName As String Private sSessionManager As String Private sLogonID As String Private ADOCnn As ADODB.Connection Private oRtnRecordSet As New ADODB.Recordset Public Function ActiveUser() As Variant On Error GoTo E Set ActiveUser = oEntireNetwork.CurrentUser E: If Err.Number <> 0 Then Set ActiveUser = Nothing End Function Public Function Users() As Variant On Error GoTo E Set Users = oEntireNetwork.MyRealm.Users E: If Err.Number <> 0 Then Set Users = Nothing End Function Public Function Groups() As Variant On Error GoTo E Set Groups = oEntireNetwork.MyRealm.Groups E: If Err.Number <> 0 Then Set Groups = Nothing End Function Private Sub Class_Initialize() Dim iLoop On Error GoTo E bLogError = True sLogErrorPath = App.Path iDebugLevel = 1 iLoop = 0 If oEntireNetwork Is Nothing Then Set oEntireNetwork = New FNCE.EntireNetwork End If If bLogError = True Then WriteMsgToLogFile 1, "MyFNCE.ObjectStore:Class_Initialize()" End If E: If Err.Number <> 0 Then If bLogError = True Then WriteMsgToLogFile 1, "MyFNCE.ObjectStore:Class_Initialize() -- Exception Error #" & Err.Number & ": " & Err.Description End If End If End Sub
So no more class initiation, my ASP can't call object properties or functions.