Hi,
The project I'm working on consists mainly of legacy VC6 C++ and VB,
but we wish to write all new code in C#. So I'm looking at ways for
exposing .NET functionality to VB and C++ through COM.
I'm attempting to develop an ATL wrapper to expose a COM interface to
a .NET assembly (I don't want to have to sign the .NET assembly to
expose directly).
So I've developed a ATL control (non-attributed) that maps COM calls
to .NET calls, and .NET events to COM connection points. Its set as
invisible at runtime (so it can be used easily in VB), and the
project has managed extensions enabled. All this works fine if I make
one off calls with managed types declared on the stack, but I need to
retain context across many calls.
The ATL control needs to hold a pointer to the managed C# object
instance, so I'm attempting to use gcroot<T> template to
declare a member variable. As soon as I do this, I get a compiler
error C2872 : 'IServiceProvider' : ambiguous symbol. And, further
detail tells me that IServiceProvider could be in either atlhost.h or
stdafx.cpp.
What do I need to do to resolve this ambiguity?
Neville