Hi all,
Since our project have to support legacy VB6 client also, I created COM+ using .NET.
First time I create COM+ using .NET 1.1 version.
VB6 client calls the COM+ Application class and calls Exectue4VB() method.
There was no problem. I test it all and worked as expected.
We decided to convert COM+ code using .NET 2.0.
However when I converted the code to .NET2.0, it stops work!!
So, I created small test COM+ and test vb6 client.
It doesn't work. It works perfectly ok with COM+ written in .NET1.1.
Error is : Object doesn't support this property or method
It's so wired. What is problem .NET2.0 doesn't support it anymore or what
It's same code. I've searched all around to find related doc. I couldn't find any.
Any comment helps.
Thank you all.
Here is sample code:
using System;
using System.Collections.Generic;
using System.Text;
using System.EnterpriseServices;
using System.Runtime.InteropServices;
namespace DLSBPM2.Engine
{
[Description("COM+ class.")]
[ClassInterface(ClassInterfaceType.None)]
[ObjectPooling(Enabled=true, MinPoolSize=4, MaxPoolSize=4)]
[Guid("F72E9E0F-CDFF-49A4-858F-889F868DB7F5")]
public class Application : System.EnterpriseServices.ServicedComponent {
public Application()
{
}
public object Execute4VB(object objs)
{
return "" + objs + ":" + DateTime.Now.ToLongTimeString();
}
}
}
// I added to COM+ like following
regasm DLSBPM2.Engine.dll /tlb DLSBPM2.Engine.tlb
gacutil /i DLSBPM2.Engine.dll
regsvcs /tlb:DLSBPM2.Engine.tlb DLSBPM2.Engine.dll
//And VB6 client Code sample
Option Explicit
Private Sub Command1_Click()
Dim myApplication As Object
Set myApplication = CreateObject("DLSBPM2.Engine.Application", "myserver")
Dim result
' following line of code throw Error with .NET2.0 COM+
' : Object doesn't support this property or method
result = myApplication.Execute4VB("this is test")
MsgBox result
End Sub

.NET 2.0 doesn't support COM+ for late binding? .NET2.0 COM+ for VB6 client.
NotTaken
Well, COM clients get type information about the COM server by type libraries. You choose to use no explicit interface by specifying ClassInterfaceType.None. So only the late bound interface IDispatch is used. I wanted to check if the coclass generated for your .Net class exposes the IDispatch interface and if may also a dispinterface is added to the tlb. If there is a difference in the two tlb files one might possible find some attributes which could be used to work around those differences. OleView is a type library viewer, which is part of Visual Studio tools.
--
SvenC
Jon50
Did you look at the tlb with OleView What is generated, what is the difference to the tlb generated from 1.1
--
SvenC
J. Clark
MTness
Thank you for your comment.
I resolved the issue.
I changed ClassInterfaceType to AutoDispatch and it solves it like following.
[
ClassInterface(ClassInterfaceType.AutoDispatch)]The problem started from .NET1.1.
Since ClassInterfaceType.None shouldn't work in .NET1.1 even.
However, somehow they changed something or fixed bug in .NET2.0 and it stop work with None for Late binding client.
That's why it confued me.
Anyhow, thank you all.