Hi,
I performed some more investigation and hit the following. I now tried
to use the following call (in C#) to get a reference to the COM type:
object member =
Microsoft.VisualBasic.Interaction.CreateObject( "Users.Member", "" );
This would return me not a COM object, but instead a reference to
the .NET object which was originally exposed as COM. Still, I cannot
handle it as a COM type. When I call GetType() on the instance of the
object, I get:
[System.RuntimeType]: {Name = "Member" FullName = "Users.Member"}
base {System.Reflection.MemberInfo}: {Name = "Member" FullName =
"Users.Member"}
Assembly: {Users, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=aakd895346d5aa6c}
AssemblyQualifiedName: "Users.Member, User, Version=0.0.0.0,
Culture=neutral, PublicKeyToken=aakd895346d5aa6c"
The documentation of the CreateObject() method at
http://msdn2.microsoft.com/en-us/library/microsoft.visualbasic.interaction.creat
eobject.aspx
reads:
"Creates and returns a reference to a COM object. CreateObject cannot
be used to create instances of classes in Visual Basic unless those
classes are explicitly exposed as COM components."
Strictly spoken, I do not get a reference to a COM object but to
a .NET object. There is nothing COM to it anymore.
If I would replace Users.Member with a PROGID of a COM type that I
know is unmanaged code, I would see that it is exposed as a COM
object. Performing a GetType() on this object, I get:
[System.RuntimeType]: {Name = "__ComObject" FullName =
"System.__ComObject"}
base {System.Reflection.MemberInfo}: {Name = "__ComObject"
FullName = "System.__ComObject"}
Assembly: {mscorlib, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b44a5d511234d013}
AssemblyQualifiedName: "System.__ComObject, mscorlib,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b44a5d511234d013"
I hope anyone can give me a clarification on this.
Thanks,
Tim
On 14 Dec, 11:46, tim.vanhek...@googlemail.com wrote:
> Hi,
>
[quoted text clipped - 15 lines]
>
> Tim
How did you define the COM interface.
.Net doesn't support the classinteface. (AutoDual) You need to either use a
dispatch-only (AutoDispatch) or an explicit interface (None).