Also you are talking about Managed C++. Note this is deprecated.
You should be using C++/CLI in VS 2005 nowadays...
I had posted there, but didn't get any reponses.
It seems in C# one doesn't need to explicitly define any COM object, just
create an ordinary .NET interface like the one I included in my post, with
extra annotations that identify which COM interface it represents.
I was wondering how to achieve the same in MC++. Ideally, without even
having to manually define the .NET interface that represents the COM
interface, like in this C# example. After all, unlike in C#, in managed
all such "original" COM interfaces are available for the programmer, for
So, is there a way to use those existing COM interfaces in MC++ in a
class without the need for such managed wrappers like the one I attached
below in C#?
"Alexander Nickolov" wrote:
The right group would be:
I assume it's not any different from C# - you create a COM
Interop object implementing the COM interface to forward it to
your .NET object implementing a compatible .NET interface.
Of course I know next to nothing about .NET and COM
Interop, so don't quote me...
Microsoft MVP [VC], MCSD
MVP VC FAQ: http://www.mvps.org/vcfaq
"krzys" <email@example.com> wrote in message
I'm posting here because I couldn't get any help in other managed
After hours of browsing I can't find any hints on how to implement a
component using a managed C++ class.
In C# this is trivial, you import the interface like below and just
In C++ neither inheriting such unmanaged interfaces nor adding the
IMPLEMENTS_INTERFACE sections appears to work. The documentation
provide any clue.
How to achieve this in managed C++? I'd rather not use ATL or other
technologies unless absolutely necessary.
internal interface IPersistFolder
void GetClassID(ref Guid pClassID);
long Initialize(IntPtr pidl);