In Managed C++ in order to share the functionality of a class between
its CLR code and native C++ code, in essence mixed mode programming for
a class, I would design the __gc class so its corresponding __nogc C++
class would be a nested class of the __gc class. The __gc class would
have a pointer to the __nogc C++ class as a private data member. Then
when the __gc class created an object of the native class, it would pass
itself as a pointer to the __nogc C++ class's constructor. The __nogc
class would put this pointer into a corresponding gcroot<>. Then the
__nogc class would be able to access all the members of its
corresponding __gc class via this pointer since, in the 2003 C++ update,
a nested class now has access to all the members of its enclosing class
via a pointer to that class, and VC++ implements that 2003 C++ item.
Now in C++/CLI using this same technique I am told that a ref class can
not have a nested native C++ class.
Oh brother !!!!!
How I am now supposed to access the public, protected, and private
members of a ref class from its corresponding native C++ class using
mixed mode programming in C++/CLI ?
If you tell me that I have to now redesign all my Managed C++ code so
that protected and private data members of my class must now be passed
to a corresponding native C++ class whenever it needs this
functionality, I will not be a happy camper. 1 2148
Edward Diener wrote: In Managed C++ in order to share the functionality of a class between its CLR code and native C++ code, in essence mixed mode programming for a class, I would design the __gc class so its corresponding __nogc C++ class would be a nested class of the __gc class. The __gc class would have a pointer to the __nogc C++ class as a private data member. Then when the __gc class created an object of the native class, it would pass itself as a pointer to the __nogc C++ class's constructor. The __nogc class would put this pointer into a corresponding gcroot<>. Then the __nogc class would be able to access all the members of its corresponding __gc class via this pointer since, in the 2003 C++ update, a nested class now has access to all the members of its enclosing class via a pointer to that class, and VC++ implements that 2003 C++ item.
Now in C++/CLI using this same technique I am told that a ref class can not have a nested native C++ class.
Oh brother !!!!!
How I am now supposed to access the public, protected, and private members of a ref class from its corresponding native C++ class using mixed mode programming in C++/CLI ?
If you tell me that I have to now redesign all my Managed C++ code so that protected and private data members of my class must now be passed to a corresponding native C++ class whenever it needs this functionality, I will not be a happy camper.
I can now see that the only solution in C++/CLI is:
1) Make the native C++ class a separate class in the same assembly
2) Change 'protected' members in my ref class which I want
to access from my native C++ class to 'protected public'.
3) Change 'private' members in my ref class which I want
to access from my native C++ class to 'internal'. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Mike Kamzyuk |
last post by:
Hello all. Basically, I need to call a mixed-mode dll's function
(which uses managed code) from a native or mixed-mode dll function
(which does not use managed code). I'm wondering if this could...
|
by: Edward Diener |
last post by:
I have some questions about the instructions for creating a mixed mode DLL
in the MSDN topic "Converting Managed Extensions for C++ Projects from Pure
Intermediate Language to Mixed Mode" in the...
|
by: Edward Diener |
last post by:
I received no answers about this the first time I posted, so I will try
again. My inability to decipher an MSDN topic may find others who have the
same inability and someone who can decipher and...
|
by: Bern McCarty |
last post by:
Is it at all possible to leverage mixed-mode assemblies from AppDomains
other than the default AppDomain? Is there any means at all of doing this?
Mixed-mode is incredibly convenient, but if I...
|
by: Nadav |
last post by:
Hi,
I am writing a performence critical application, this require me to stick to unmanaged C++ as performance is much better using unmanaged C++ ( about 33% better ), Still, I am trying to avoid...
|
by: Lonewolf |
last post by:
hi,
I'm still in the process of transiting from MFC/VC6 to vs2005, and a
lot of things are very alien to me. So hope you could bear with me if my
question sounds stupid. Basically I have native...
|
by: Doug Belkofer |
last post by:
We have created a fairly complex mixed-mode DLL that we want to use from
VB.NET. The mixed-mode DLL is written in C++, and does use the standard C
runtime libraries. An unusual thing is happening...
|
by: Edward Diener |
last post by:
By reuse, I mean a function in an assembly which is called in another
assembly.
By a mixed-mode function I mean a function whose signature has one or
more CLR types and one or more non-CLR...
|
by: emu |
last post by:
Hi All,
I have an unmanaged C++ application that references a mixed mode image
DLL (mixed managed and unmanaged). Under .NET 1.1 we could trust the
dll (the mixed mode dll) by running the...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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,...
|
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...
|
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: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
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: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| |