Implement COM interface in managed C++. -
05-20-2006
, 09:34 PM
I'm posting here because I couldn't get any help in other managed groups.
After hours of browsing I can't find any hints on how to implement a COM
component using a managed C++ class.
In C# this is trivial, you import the interface like below and just
implement it.
In C++ neither inheriting such unmanaged interfaces nor adding the
IMPLEMENTS_INTERFACE sections appears to work. The documentation doesn't
provide any clue.
How to achieve this in managed C++? I'd rather not use ATL or other non-.NET
technologies unless absolutely necessary.
[ComImport(), Guid("000214EA-0000-0000-C000-000000000046"),
InterfaceType(ComInterfaceType.InterfaceIsIUnknown )]
internal interface IPersistFolder
{
void GetClassID(ref Guid pClassID);
[PreserveSig]
long Initialize(IntPtr pidl);
} |