Skip to content

Latest commit

 

History

History
106 lines (85 loc) · 8.13 KB

platform-namespace-c-cx.md

File metadata and controls

106 lines (85 loc) · 8.13 KB
descriptiontitlems.datems.topicf1_keywordshelpviewer_keywordsms.assetid
Learn more about: Platform namespace (C++/CX)
Platform namespace (C++/CX)
12/30/2016
reference
Platform/Platform
Platform Namespace (C++/CX)
b160e822-d424-43d2-ba60-57b0e81f259c

Platform namespace (C++/CX)

Contains built-in types that are compatible with the Windows Runtime.

Syntax

usingnamespacePlatform;

Members

Attributes

The Platform namespace contains attributes, classes, enumerations, interfaces, and structures. Platform also contains nested namespaces.

AttributeDescription
FlagsIndicates that an enumeration can be treated as a bit field; that is, a set of flags.
MTAThreadIndicates that the threading model for an application is multi-threaded apartment (MTA).
STAThreadIndicates that the threading model for an application is single-threaded apartment (STA).

Classes

The Platform namespace has the following classes.

ClassDescription
Platform::AccessDeniedException ClassRaised when access is denied to a resource or feature.
Platform::Agile ClassRepresents a non-agile object as an agile object.
Platform::Array ClassRepresents a one-dimensional, modifiable array.
Platform::ArrayReference ClassRepresents an array whose initialization is optimized to minimize copying operations.
Platform::Box ClassUsed to declare a boxed type that encapsulates a value type such as Windows::Foundation::DateTime or int64 when that type is passed across the application binary interface (ABI) or stored in a variable of type Platform::Object^.
Platform::ChangedStateException ClassThrown when methods of a collection iterator or a collection view are called after the parent collection has changed, invalidating the results of the method.
Platform::ClassNotRegisteredException ClassThrown when a COM class has not been registered.
Platform::COMException ClassRepresents the exception that is thrown when an unrecognized value is returned from a COM method call.
Platform::Delegate ClassRepresents the signature of a callback function.
Platform::DisconnectedException ClassThe object has disconnected from its clients.
Platform::Exception ClassRepresents errors that occur during application execution. The base class for exceptions.
Platform::FailureException ClassThrown when the operation has failed. It is the equivalent of the E_FAIL HRESULT.
Platform::Guid value classRepresents a GUID in the Windows Runtime type system.
Platform::InvalidArgumentException ClassThrown when one of the arguments provided to a method is not valid.
Platform::InvalidCastException ClassThrown in cases of invalid casting or explicit conversion.
Platform::MTAThreadAttribute ClassIndicates that the threading model for an application is multi-threaded apartment (MTA).
Platform::NotImplementedException ClassThrown if an interface method has not been implemented on the class.
Platform::NullReferenceException ClassThrown when there is an attempt to dereference a null object reference.
Platform::Object ClassA base class that provides common behavior.
Platform::ObjectDisposedException ClassThrown when an operation is performed on a disposed object.
Platform::OperationCanceledException ClassThrown when an operation is aborted.
Platform::OutOfBoundsException ClassThrown when an operation attempts to access data outside the valid range.
Platform::OutOfMemoryException ClassThrown when there's insufficient memory to complete the operation.
Platform::STAThreadAttribute ClassIndicates that the threading model for an application is single-threaded apartment (STA).
Platform::String ClassA sequential collection of Unicode characters that is used to represent text.
Platform::StringReference ClassEnables access to string buffers with minimum of copy overhead.
Platform::Type ClassIdentifies a built-in type by a category enumeration.
Platform::ValueType ClassThe base class for instances of value types.
Platform::WeakReference ClassProvides a weak reference to ref class objects that does not increment the reference count.
Platform::WriteOnlyArray ClassRepresents a one-dimensional write-only array which is used as an input parameter on methods that implement the FillArray pattern.
Platform::WrongThreadException ClassThrown when a thread calls via an interface pointer which is for a proxy object that does not belong to the thread's apartment.

Interface implementations

The Platform namespace defines the following interfaces.

InterfaceDescription
Platform::IBox InterfaceUsed to pass value types to functions whose parameters are typed as Platform::Object^.
Platform::IBoxArray InterfaceInterface used to pass arrays of value types to functions whose parameters are typed as Platform::Array.
Platform::IDisposable InterfaceUsed to release unmanaged resources.

Enumerations

The Platform namespace has the following enumerations.

InterfaceDescription
Platform::CallbackContext EnumerationAn enumeration that is used as a parameter of the delegate constructor. It determines whether the callback is to be marshalled to the originating thread or to the caller thread.
Platform::TypeCode EnumerationSpecifies a numeric category that represents a built-in type.

Structures

The Platform namespace has the following structures.

StructureDescription
Platform::Enum ClassRepresents a named constant.
Platform::Guid value classRepresents a GUID.
Platform::IntPtr value classA signed pointer whose size is appropriate for the platform (32-bit or 64-bit).
Platform::SizeT value classAn unsigned data type used to represent the size of an object.
Platform::UIntPtr value classAn unsigned pointer whose size is appropriate for the platform (32-bit or 64-bit).

See also

Platform::Collections Namespace
Platform::Runtime::CompilerServices Namespace
Platform::Runtime::InteropServices Namespace
Platform::Metadata Namespace

close