How to use a namespace
In the standard C ++, The namespace is used to prevent type conflicts.ProgramType is added to the namespace, which is a syntax specification for Windows runtime. Namespaces can be nested for use.
See the following example:
Namespace Test
{
Public ref class myclass {};
Public Delegate void mydelegate ();
Namespace nestednamespace
{
Public ref class myclass2
{
Event test: mydelegate ^ policy;
};
}
}
In myclass2, the following types of test space must be called through test.
WindowsRuntime namespace
The APIs used when running Windows are in the Windows: * namespace, which can be defined in the windows. winmd file. These namespaces are reserved for Windows and cannot be used by other third-party custom types.
C ++/CXNamespace
namespace |
description |
default |
contains numbers and char16 types. |
platform |
contains some main types of Windows runtime, such as array , String, guid, and Boolean. It also contains some special help types such as platform: Agile and platform: Box .. |
platform: collections |
contains the set types integrated from interfaces such as ivector and IMAP. These types are defined in the collection. h header file, not in platform. winmd .. |
platform: Details |
the types used in the compiler are not publicly available. |