473,396 Members | 1,827 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.

A native 'public class' or 'private class' in VC8

Specifying 'public class' or 'private class' for C++ class definitions
is not part of the C++ standard. In a topic in the VS 2005 docs 'How to:
Declare public and private on Native classes', it is suggested that this
syntax is supported with VC8 for interaction with CLR ref classes and
for specifying in a CLR assembly.

However in the specific C++ language documentation for native classes,
there is no mention of the possibility of prepending 'class' with either
'public' or 'private'. Furthermore where it is explained in the first
topic above there is no explanation of what it actually means for native
classes, other than the implied suggestion that it treats native classes
like ref classes in CLR assemblies as regards the 'public' and 'private'
keywords in front of a ref class.

Can anybody clear up for me whether this is supported for native classes
in CLR assemblies and what it actually means given the abysmal MSDN
documentation on it ?
Aug 5 '06 #1
2 1148
"Edward Diener" <ed*******************@tropicsoft.comwrote
However in the specific C++ language documentation for native classes,
there is no mention of the possibility of prepending 'class' with either
'public' or 'private'. Furthermore where it is explained in the first
topic above there is no explanation of what it actually means for native
classes, other than the implied suggestion that it treats native classes
like ref classes in CLR assemblies as regards the 'public' and 'private'
keywords in front of a ref class.
The compiler emits value type definitions for native classes. Note
that these specify size and alignment only and the layout is done
at the C++ compiler's discretion. I guess, that was just a convenient
way to emit code from a lowered IR.

The access specifier controls the visibility of the generated value type.

-hg
Aug 5 '06 #2
Yes, EVERY (no matter if you use #pragma managed or #pragma unmanaged)
native class ends up as a managed value type in the assembly.

"Edward Diener" <ed*******************@tropicsoft.comschrieb im
Newsbeitrag news:OC****************@TK2MSFTNGP06.phx.gbl...
Specifying 'public class' or 'private class' for C++ class definitions is
not part of the C++ standard. In a topic in the VS 2005 docs 'How to:
Declare public and private on Native classes', it is suggested that this
syntax is supported with VC8 for interaction with CLR ref classes and for
specifying in a CLR assembly.

However in the specific C++ language documentation for native classes,
there is no mention of the possibility of prepending 'class' with either
'public' or 'private'. Furthermore where it is explained in the first
topic above there is no explanation of what it actually means for native
classes, other than the implied suggestion that it treats native classes
like ref classes in CLR assemblies as regards the 'public' and 'private'
keywords in front of a ref class.

Can anybody clear up for me whether this is supported for native classes
in CLR assemblies and what it actually means given the abysmal MSDN
documentation on it ?

Aug 5 '06 #3

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

Similar topics

4
by: David Kantowitz | last post by:
I am trying to wrap a native-C++ DLL in managed C++, to use in a .NET project. The native code is compiled into a DLL, and I have created a .def file that exports the mangled names of the...
2
by: Martin Zenkel | last post by:
Dear VS Team, using the Beta 2 of VS 2005 I've encontered the following problem. Let's assume threre are three Dll's, one unmanaged and two managed. In the unmanaged we put a simple unmanged...
1
by: Bern McCarty | last post by:
What do you make of this? I cannot tell for sure but it almost seems as the the transition thunk to get back from the native bool method to the managed caller is looking at eax and, if any bit is...
11
by: pamelafluente | last post by:
I am doing my own PrintDialog, and have placed there a combo with the printer names, as in the PrintDialog provided by VB.NET. Here is the question: how do I open the native windows printer...
1
by: lallous | last post by:
Hello I don't have C++/CLI 2.0 reference handy and the code below was written after long hours of research and shallow readings. From what I see, the code works and looks logical to me. Can you...
1
by: =?Utf-8?B?RmFiaWFu?= | last post by:
Hello, I want to give multiple native classes (in different mixed mode dlls) access to a managed output window (for error messages). Therefore I wrote a native singleton with __declspec...
0
by: Ed | last post by:
Hi, dear all, I want to wrapper the legacy C++ Template Class to be used by the C# code, so I try to wrapper the legacy C++ code into CLI/C++ code first. One problem is how to wrapper C++...
4
by: rwf_20 | last post by:
I'm seeing incorrect (I think) behavior in the event of an exception thrown in a native C++ library. Basically, the stack appears to unwind correctly if the caller is native, but incorrectly if...
2
by: Bob Altman | last post by:
Hi all, We have a native class modeled after the System::Exception class, and all exceptions that we throw derive from this class. For now this class is quite simple: just Description and...
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
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
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...

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.