473,396 Members | 1,918 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

gcroot<T> in ATL results in error C2872 : 'IServicePro

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

Nov 22 '05 #1
0 1355

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: nmyatt | last post by:
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...
2
by: Tommy Vercetti | last post by:
I'm new to Managed C++ development, and I can't seem to get started. Every time I try to include vcclr.h I get bizarre compilation errors. I've isolated this to a really simple case: In Visual...
5
by: Gerhard Menzl | last post by:
Has anyone ever tried to sort a Standard Library container of gcroots? I have run into the problem that somewhere deep in the Library logic (in line 338 of <memory>, to be precise) the destructor...
0
by: Gerhard Menzl | last post by:
The following Managed C++ code when built using Visual Studio .NET 2003: #include <vector> #include <vcclr.h> __gc class Tester { public: typedef gcroot<Object*> TestPtr;
8
by: =?Utf-8?B?V2hpdG5leSBLZXc=?= | last post by:
Hi there, I'm having a bit of trouble using an HRASCONN object as a class member variable inside my managed C++ class. When I call RasDial() and pass in the address of my HRASCONN object, I get...
6
by: =?Utf-8?B?RmFiaWFu?= | last post by:
Hello, I have a class hierarchy distributed over 3 native C++ dlls. The base class has a .NET Windows.Form for status output via a gcroot<>. The gcroot is declared private - the sub classes only...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.