473,387 Members | 1,582 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,387 software developers and data experts.

How to query interface using gcroot?

I have a few C# .NET components which might implement one
or several interfaces, let say I1, I2 and I3.

The unmanaged C++ client consumes this component using
gcroot template pointer. How client application can find out
what interfaces implement certain instance of the pointer?
I need some kind of QueryInterface method which allows me
to query for certain interface. How can I do that if I use gcroot
template? Thanks.
Nov 17 '05 #1
2 1977
For managed code you can use a cast to serve as a QI call. Native code has
no way to do anything with the handle encapsulated by gcroot. They only
thing it offers is the ability to move the handle through native code and
data for later manipulation by managed code.

Ronald Laeremans
Visual C++ team

"Dave" <Da**@discussions.microsoft.com> wrote in message
news:1C**********************************@microsof t.com...
I have a few C# .NET components which might implement one
or several interfaces, let say I1, I2 and I3.

The unmanaged C++ client consumes this component using
gcroot template pointer. How client application can find out
what interfaces implement certain instance of the pointer?
I need some kind of QueryInterface method which allows me
to query for certain interface. How can I do that if I use gcroot
template? Thanks.

Nov 17 '05 #2
Ronald,

Thank you for your response. Could you provide an example of
"cast serving as a QI call"

Thanks,
Dave

"Ronald Laeremans [MSFT]" wrote:
For managed code you can use a cast to serve as a QI call. Native code has
no way to do anything with the handle encapsulated by gcroot. They only
thing it offers is the ability to move the handle through native code and
data for later manipulation by managed code.

Ronald Laeremans
Visual C++ team

"Dave" <Da**@discussions.microsoft.com> wrote in message
news:1C**********************************@microsof t.com...
I have a few C# .NET components which might implement one
or several interfaces, let say I1, I2 and I3.

The unmanaged C++ client consumes this component using
gcroot template pointer. How client application can find out
what interfaces implement certain instance of the pointer?
I need some kind of QueryInterface method which allows me
to query for certain interface. How can I do that if I use gcroot
template? Thanks.


Nov 17 '05 #3

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

Similar topics

3
by: Ben Terry | last post by:
I have imported a legacy C++ project into a VisualStudio.NET 2003 solution. I have some new C# projects in the solution as well. I am using the managed extensions in my C++ project so that I can...
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: Rob Haynes | last post by:
I have a DLL with vanilla C functions implemented. I'd like these functions to become wrappers for a managed object. So, I was thinking that the first call would save a pointer statically to the...
4
by: John | last post by:
I'm having a major problem trying to use value types like System::Drawing::Rectangle with std::vector. Is it possible to use STL containers with these type of objects, or am I just doing something...
12
by: DaTurk | last post by:
Hi, I have a rather interesting problem. I have a unmanged c++ class which needs to communicate information to managed c++ via callbacks, with a layer of c# on top of the managed c++ ultimatley...
6
by: =?Utf-8?B?QWw=?= | last post by:
I am storing an array of strings in an unmanaged MFC class using gcroot as follows: gcroot<array<System::String^>^m_pArr; Nothing out of the ordinary there. However, if I try to use "delete...
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...
6
by: Bob Altman | last post by:
Hi all, In C++/CLI (VS 2005) I have a C++ module compiled with /clr that contains a module-level gcroot variable: static gcroot<MyList^m_myList = gcnew MyList; In the above statement,...
7
by: christian2.schmidt | last post by:
Hi, I'm trying to wrap an IList-instance in a native template class with a "vector"-like interface. cliext::vector seems not suited, as it copies the list - correct me if I'm wrong. template...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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,...

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.