all groups > dotnet interop > august 2005 >
You're in the

dotnet interop

group:

IEnumUnknown realization in .NET


IEnumUnknown realization in .NET dumchikov NO[at]SPAM gmail.com
8/29/2005 9:10:38 AM
dotnet interop: Hi,

I need to realize IEnumUnknown interface in .NET. So I described
IEnumUnknown in .NET as:

[ComImport]
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
[Guid("00000100-0000-0000-C000-000000000046")]
public interface IEnumUnknown
{
void Next(UInt32 requestedNumber,
[MarshalAs(UnmanagedType.IUnknown)] out Object buffer, out UInt32
fetchedNumber);

void Skip(UInt32 number);

void Reset();

void Clone(out IEnumUnknown result);
}

Then I tried to realized this interface in the MyClass

public class MyClass : IEnumUnknown
{
//Methods
}

But when I compiled the assembly and generated the tlb-file I saw, that
there was coclass MyClass, but it didn't implement interface IUnknown.
Why?
Re: IEnumUnknown realization in .NET Mattias Sjögren
8/29/2005 6:46:31 PM
[quoted text, click to view]

You mean IEnumUnknown? It's not listed in the typelib because you
(correctly) marked it with the ComImport attribute. It will still be
available via QueryInterface at runtime though so don't worry.


Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Re: IEnumUnknown realization in .NET dumchikov NO[at]SPAM gmail.com
8/30/2005 12:03:24 AM
Thanks a lot
AddThis Social Bookmark Button