Windows 8 C ++/CX namespace

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.