Rate This Content
MSDN
MSDN Library
.NET Development
.NET Framework 3.5

  Switch on low bandwidth view

We were unable to locate this content in hi-in.

Here is the same content in en-us.

This page is specific to
Microsoft Visual Studio 2008/.NET Framework 3.5

Other versions are also available for the following:
.NET Framework Class Library
System.Runtime.InteropServices Namespace

The System.Runtime.InteropServices namespace provides a wide variety of members that support COM interop and platform invoke services. If you are unfamiliar with these services, see Interoperating with Unmanaged Code.

Members of this namespace provide several categories of functionality, as shown in the following table. Attributes control marshaling behavior, such as how to arrange structures or how to represent strings. The most important attributes are DllImportAttribute, which you use to define platform invoke methods for accessing unmanaged APIs, and MarshalAsAttribute, which you use to specify how data is marshaled between managed and unmanaged memory.

  ClassDescription
Public classAllowReversePInvokeCallsAttribute Allows an unmanaged method to call a managed method.
Public classAutomationProxyAttribute Specifies whether the type should be marshaled using the Automation marshaler or a custom proxy and stub.
Public classBestFitMappingAttribute Controls whether Unicode characters are converted to the closest matching ANSI characters.
Public classBStrWrapper Marshals data of type VT_BSTR from managed to unmanaged code. This class cannot be inherited.
Public classClassInterfaceAttribute Indicates the type of class interface to be generated for a class exposed to COM, if an interface is generated at all.
Public classCoClassAttribute Specifies the class identifier of a coclass imported from a type library.
Public classComAliasNameAttribute Indicates the COM alias for a parameter or field type.
Public classComCompatibleVersionAttribute Indicates to a COM client that all classes in the current version of an assembly are compatible with classes in an earlier version of the assembly.
Public classComConversionLossAttribute Indicates that information was lost about a class or interface when it was imported from a type library to an assembly.
Public classComDefaultInterfaceAttribute Specifies a default interface to expose to COM. This class cannot be inherited.
Public classComEventInterfaceAttribute Identifies the source interface and the class that implements the methods of the event interface that is generated when a coclass is imported from a COM type library.
Public classCOMException The exception that is thrown when an unrecognized HRESULT is returned from a COM method call.
Public classComImportAttribute Indicates that the attributed type was previously defined in COM.
Public classComRegisterFunctionAttribute Specifies the method to call when you register an assembly for use from COM; this enables the execution of user-written code during the registration process.
Public classComSourceInterfacesAttribute Identifies a list of interfaces that are exposed as COM event sources for the attributed class.
Public classComUnregisterFunctionAttribute Specifies the method to call when you unregister an assembly for use from COM; this allows for the execution of user-written code during the unregistration process.
Public classComVisibleAttribute Controls accessibility of an individual managed type or member, or of all types within an assembly, to COM.
Public classCriticalHandle Represents a wrapper class for handle resources.
Public classCurrencyWrapper Wraps objects the marshaler should marshal as a VT_CY.
Public classDefaultCharSetAttribute Specifies the value of the CharSet enumeration. This class cannot be inherited.
Public classDefaultParameterValueAttribute Sets the default value of a parameter when called from a language that supports default parameters. This class cannot be inherited.
Public classDispatchWrapper Wraps objects the marshaler should marshal as a VT_DISPATCH.
Public classDispIdAttribute Specifies the COM dispatch identifier (DISPID) of a method, field, or property.
Public classDllImportAttribute Indicates that the attributed method is exposed by an unmanaged dynamic-link library (DLL) as a static entry point.
Public classErrorWrapper Wraps objects the marshaler should marshal as a VT_ERROR.
Public classExtensibleClassFactory Enables customization of managed objects that extend from unmanaged objects during creation.
Public classExternalException The base exception type for all COM interop exceptions and structured exception handling (SEH) exceptions.
Public classFieldOffsetAttribute Indicates the physical position of fields within the managed and unmanaged representation of a class or structure.
Public classGuidAttribute Supplies an explicit System..::.Guid when an automatic GUID is undesirable.
Public classHandleCollector Tracks outstanding handles and forces a garbage collection when the specified threshold is reached.
Public classIDispatchImplAttribute Obsolete. Indicates which IDispatch implementation the common language runtime uses when exposing dual interfaces and dispinterfaces to COM.
Public classImportedFromTypeLibAttribute Indicates that the types defined within an assembly were originally defined in a type library.
Public classInAttribute Indicates that data should be marshaled from the caller to the callee, but not back to the caller.
Public classInterfaceTypeAttribute Indicates whether a managed interface is dual, dispatch-only, or IUnknown -only when exposed to COM.
Public classInvalidComObjectException The exception thrown when an invalid COM object is used.
Public classInvalidOleVariantTypeException The exception thrown by the marshaler when it encounters an argument of a variant type that can not be marshaled to managed code.
Public classLCIDConversionAttribute Indicates that a method's unmanaged signature expects a locale identifier (LCID) parameter.
Public classMarshalProvides a collection of methods for allocating unmanaged memory, copying unmanaged memory blocks, and converting managed to unmanaged types, as well as other miscellaneous methods used when interacting with unmanaged code.
Public classMarshalAsAttribute Indicates how to marshal the data between managed and unmanaged code.
Public classMarshalDirectiveException The exception that is thrown by the marshaler when it encounters a MarshalAsAttribute it does not support.
Public classOptionalAttribute Indicates that a parameter is optional.
Public classOutAttribute Indicates that data should be marshaled from callee back to caller.
Public classPreserveSigAttribute Indicates that the HRESULT or retval signature transformation that takes place during COM interop calls should be suppressed.
Public classPrimaryInteropAssemblyAttribute Indicates that the attributed assembly is a primary interop assembly.
Public classProgIdAttribute Allows the user to specify the ProgID of a class.
Public classRegistrationServices Provides a set of services for registering and unregistering managed assemblies for use from COM.
Public classRuntimeEnvironment Provides a collection of static methods that return information about the common language runtime environment.
Public classSafeArrayRankMismatchException The exception thrown when the rank of an incoming SAFEARRAY does not match the rank specified in the managed signature.
Public classSafeArrayTypeMismatchException The exception thrown when the type of the incoming SAFEARRAY does not match the type specified in the managed signature.
Public classSafeHandle Represents a wrapper class for operating system handles. This class must be inherited.
Public classSEHExceptionRepresents Structured Exception Handler (SEH) errors.
Public classSetWin32ContextInIDispatchAttribute Obsolete. This attribute has been deprecated.
Public classStandardOleMarshalObject Replaces the standard common language runtime (CLR) free-threaded marshaler with the standard OLE STA marshaler.
Public classStructLayoutAttribute The StructLayoutAttribute class allows the user to control the physical layout of the data fields of a class or structure.
Public classTypeLibConverter Provides a set of services that convert a managed assembly to a COM type library and vice versa.
Public classTypeLibFuncAttribute Contains the FUNCFLAGS that were originally imported for this method from the COM type library.
Public classTypeLibImportClassAttribute Specifies which Type exclusively uses an interface. This class cannot be inherited.
Public classTypeLibTypeAttribute Contains the TYPEFLAGS that were originally imported for this type from the COM type library.
Public classTypeLibVarAttribute Contains the VARFLAGS that were originally imported for this field from the COM type library.
Public classTypeLibVersionAttribute Specifies the version number of an exported type library.
Public classUnknownWrapper Wraps objects the marshaler should marshal as a VT_UNKNOWN.
Public classUnmanagedFunctionPointerAttribute Controls the marshaling behavior of a delegate signature passed as an unmanaged function pointer to or from unmanaged code. This class cannot be inherited.
Public classVariantWrapper Marshals data of type VT_VARIANT | VT_BYREF from managed to unmanaged code. This class cannot be inherited.
  StructureDescription
Public structureArrayWithOffset Encapsulates an array and an offset within the specified array.
Public structureBIND_OPTS Obsolete. Use System.Runtime.InteropServices.ComTypes..::.BIND_OPTS instead.
Public structureBINDPTR Obsolete. Use System.Runtime.InteropServices.ComTypes..::.BINDPTR instead.
Public structureCONNECTDATA Obsolete. Use System.Runtime.InteropServices.ComTypes..::.CONNECTDATA instead.
Public structureDISPPARAMS Obsolete. Use System.Runtime.InteropServices.ComTypes..::.DISPPARAMS instead.
Public structureELEMDESC Obsolete. Use System.Runtime.InteropServices.ComTypes..::.ELEMDESC instead.
Public structureELEMDESC..::.DESCUNION Use System.Runtime.InteropServices.ComTypes..::.ELEMDESC..::.DESCUNION instead.
Public structureEXCEPINFO Obsolete. Use System.Runtime.InteropServices.ComTypes..::.EXCEPINFO instead.
Public structureFILETIME Obsolete. Use System.Runtime.InteropServices.ComTypes..::.FILETIME instead.
Public structureFUNCDESC Obsolete. Use System.Runtime.InteropServices.ComTypes..::.FUNCDESC instead.
Public structureGCHandle Provides a means for accessing a managed object from unmanaged memory.
Public structureHandleRef Wraps a managed object holding a handle to a resource that is passed to unmanaged code using platform invoke.
Public structureIDLDESC Obsolete. Use System.Runtime.InteropServices.ComTypes..::.IDLDESC instead.
Public structurePARAMDESC Obsolete. Use System.Runtime.InteropServices.ComTypes..::.PARAMDESC instead.
Public structureSTATSTG Obsolete. Use System.Runtime.InteropServices.ComTypes..::.STATSTG instead.
Public structureTYPEATTR Obsolete. Use System.Runtime.InteropServices.ComTypes..::.TYPEATTR instead.
Public structureTYPEDESC Obsolete. Use System.Runtime.InteropServices.ComTypes..::.TYPEDESC instead.
Public structureTYPELIBATTR Obsolete. Use System.Runtime.InteropServices.ComTypes..::.TYPELIBATTR instead.
Public structureVARDESC Obsolete. Use System.Runtime.InteropServices.ComTypes..::.VARDESC instead.
Public structureVARDESC..::.DESCUNION Use System.Runtime.InteropServices.ComTypes..::.VARDESC..::.DESCUNION instead.
  InterfaceDescription
Public interface_Activator Exposes the System..::.Activator class to unmanaged code.
Public interface_Assembly Exposes the public members of the System.Reflection..::.Assembly class to unmanaged code.
Public interface_AssemblyBuilder Exposes the System.Reflection.Emit..::.AssemblyBuilder class to unmanaged code.
Public interface_AssemblyName Exposes the AssemblyName class to unmanaged code.
Public interface_Attribute Exposes the System..::.Attribute class to unmanaged code.
Public interface_ConstructorBuilder Exposes the System.Reflection.Emit..::.ConstructorBuilder class to unmanaged code.
Public interface_ConstructorInfo Exposes the public members of the System.Reflection..::.ConstructorInfo class to unmanaged code.
Public interface_CustomAttributeBuilder Exposes the System.Reflection.Emit..::.CustomAttributeBuilder class to unmanaged code.
Public interface_EnumBuilder Exposes the System.Reflection.Emit..::.EnumBuilder class to unmanaged code.
Public interface_EventBuilder Exposes the System.Reflection.Emit..::.EventBuilder class to unmanaged code.
Public interface_EventInfo Exposes the public members of the System.Reflection..::.EventInfo class to unmanaged code.
Public interface_Exception Exposes the public members of the System..::.Exception class to unmanaged code.
Public interface_FieldBuilder Exposes the System.Reflection.Emit..::.FieldBuilder class to unmanaged code.
Public interface_FieldInfo Exposes the public members of the System.Reflection..::.FieldInfo class to unmanaged code.
Public interface_ILGenerator Exposes the System.Reflection.Emit..::.ILGenerator class to unmanaged code.
Public interface_LocalBuilder Exposes the System.Reflection.Emit..::.LocalBuilder class to unmanaged code.
Public interface_MemberInfo Exposes the public members of the System.Reflection..::.MemberInfo class to unmanaged code.
Public interface_MethodBase Exposes the public members of the System.Reflection..::.MethodBase class to unmanaged code.
Public interface_MethodBuilder Exposes the MethodBuilder class to unmanaged code.
Public interface_MethodInfo Exposes the public members of the System.Reflection..::.MethodInfo class to unmanaged code.
Public interface_MethodRental Exposes the System.Reflection.Emit..::.MethodRental class to unmanaged code.
Public interface_Module Exposes the Module class to unmanaged code.
Public interface_ModuleBuilder Exposes the System.Reflection.Emit..::.ModuleBuilder class to unmanaged code.
Public interface_ParameterBuilder Exposes the System.Reflection.Emit..::.ParameterBuilder class to unmanaged code.
Public interface_ParameterInfo Exposes the System.Reflection..::.ParameterInfo class to unmanaged code.
Public interface_PropertyBuilder Exposes the System.Reflection.Emit..::.PropertyBuilder class to unmanaged code.
Public interface_PropertyInfo Exposes the public members of the System.Reflection..::.PropertyInfo class to unmanaged code.
Public interface_SignatureHelper Exposes the System.Reflection.Emit..::.SignatureHelper class to unmanaged code.
Public interface_Thread Exposes the System.Threading..::.Thread class to unmanaged code.
Public interface_Type Exposes the public members of the System..::.Type class to the unmanaged code.
Public interface_TypeBuilder Exposes the System.Reflection.Emit..::.TypeBuilder class to unmanaged code.
Public interfaceICustomAdapter Provides a way for clients to access the actual object, rather than the adapter object handed out by a custom marshaler.
Public interfaceICustomFactory Enables users to write activation code for managed objects that extend MarshalByRefObject.
Public interfaceICustomMarshaler Designed to provide custom wrappers for handling method calls.
Public interfaceIRegistrationServices Provides a set of services for registering and unregistering managed assemblies for use from COM.
Public interfaceITypeLibConverter Provides a set of services that convert a managed assembly to a COM type library and vice versa.
Public interfaceITypeLibExporterNameProvider Provides control over the casing of names when exported to a type library.
Public interfaceITypeLibExporterNotifySink Provides a callback mechanism for the assembly converter to inform the caller of the status of the conversion, and involve the caller in the conversion process itself.
Public interfaceITypeLibImporterNotifySink Provides a callback mechanism for the type library converter to inform the caller of the status of the conversion, and involve the caller in the conversion process itself.
Public interfaceUCOMIBindCtx Obsolete. Use System.Runtime.InteropServices.ComTypes..::.BIND_OPTS instead.
Public interfaceUCOMIConnectionPoint Obsolete. Use System.Runtime.InteropServices.ComTypes..::.IConnectionPoint instead.
Public interfaceUCOMIConnectionPointContainer Obsolete. Use System.Runtime.InteropServices.ComTypes..::.IConnectionPointContainer instead.
Public interfaceUCOMIEnumConnectionPoints Obsolete. Use System.Runtime.InteropServices.ComTypes..::.IEnumConnectionPoints instead.
Public interfaceUCOMIEnumConnections Obsolete. Use System.Runtime.InteropServices.ComTypes..::.IEnumConnections instead.
Public interfaceUCOMIEnumMoniker Obsolete. Use System.Runtime.InteropServices.ComTypes..::.IEnumMoniker instead.
Public interfaceUCOMIEnumString Obsolete. Use System.Runtime.InteropServices.ComTypes..::.IEnumString instead.
Public interfaceUCOMIEnumVARIANT Obsolete. Use System.Runtime.InteropServices.ComTypes..::.IEnumVARIANT instead.
Public interfaceUCOMIMoniker Obsolete. Use System.Runtime.InteropServices.ComTypes..::.IMoniker instead.
Public interfaceUCOMIPersistFile Obsolete. Use System.Runtime.InteropServices.ComTypes..::.IPersistFile instead.
Public interfaceUCOMIRunningObjectTable Obsolete. Use System.Runtime.InteropServices.ComTypes..::.IRunningObjectTable instead.
Public interfaceUCOMIStream Obsolete. Use System.Runtime.InteropServices.ComTypes..::.IStream instead.
Public interfaceUCOMITypeComp Obsolete. Use System.Runtime.InteropServices.ComTypes..::.ITypeComp instead.
Public interfaceUCOMITypeInfo Obsolete. Use System.Runtime.InteropServices.ComTypes..::.ITypeInfo instead.
Public interfaceUCOMITypeLib Obsolete. Use System.Runtime.InteropServices.ComTypes..::.ITypeLib instead.
  DelegateDescription
Public delegateObjectCreationDelegate Creates a COM object.
  EnumerationDescription
Public enumerationAssemblyRegistrationFlags Defines a set of flags used when registering assemblies.
Public enumerationCALLCONV Obsolete. Use System.Runtime.InteropServices.ComTypes..::.CALLCONV instead.
Public enumerationCallingConvention Specifies the calling convention required to call methods implemented in unmanaged code.
Public enumerationCharSet Dictates which character set marshaled strings should use.
Public enumerationClassInterfaceType Identifies the type of class interface that is generated for a class.
Public enumerationComInterfaceType Identifies how to expose an interface to COM.
Public enumerationComMemberType Describes the type of a COM member.
Public enumerationDESCKIND Obsolete. Use System.Runtime.InteropServices.ComTypes..::.DESCKIND instead.
Public enumerationExporterEventKind Describes the callbacks that the type library exporter makes when exporting a type library.
Public enumerationFUNCFLAGS Obsolete. Use System.Runtime.InteropServices.ComTypes..::.FUNCFLAGS instead.
Public enumerationFUNCKIND Obsolete. Use System.Runtime.InteropServices.ComTypes..::.FUNCKIND instead.
Public enumerationGCHandleType Represents the types of handles the GCHandle class can allocate.
Public enumerationIDispatchImplType Obsolete. Indicates which IDispatch implementation to use for a particular class.
Public enumerationIDLFLAG Obsolete. Use System.Runtime.InteropServices.ComTypes..::.IDLFLAG instead.
Public enumerationIMPLTYPEFLAGS Obsolete. Use System.Runtime.InteropServices.ComTypes..::.IMPLTYPEFLAGS instead.
Public enumerationImporterEventKind Describes the callbacks that the type library importer makes when importing a type library.
Public enumerationINVOKEKIND Obsolete. Use System.Runtime.InteropServices.ComTypes..::.INVOKEKIND instead.
Public enumerationLayoutKind Controls the layout of an object when exported to unmanaged code.
Public enumerationLIBFLAGS Obsolete. Use System.Runtime.InteropServices.ComTypes..::.LIBFLAGS instead.
Public enumerationPARAMFLAG Obsolete. Use System.Runtime.InteropServices.ComTypes..::.PARAMFLAG instead.
Public enumerationRegistrationClassContext Specifies the set of execution contexts in which a class object will be made available for requests to construct instances.
Public enumerationRegistrationConnectionType Defines the types of connections to a class object.
Public enumerationSYSKIND Obsolete. Use System.Runtime.InteropServices.ComTypes..::.SYSKIND instead.
Public enumerationTYPEFLAGS Obsolete. Use System.Runtime.InteropServices.ComTypes..::.TYPEFLAGS instead.
Public enumerationTYPEKIND Obsolete. Use System.Runtime.InteropServices.ComTypes..::.TYPEKIND instead.
Public enumerationTypeLibExporterFlags Indicates how a type library should be produced.
Public enumerationTypeLibFuncFlags Describes the original settings of the FUNCFLAGS in the COM type library from where this method was imported.
Public enumerationTypeLibImporterFlags Indicates how an assembly should be produced.
Public enumerationTypeLibTypeFlags Describes the original settings of the TYPEFLAGS in the COM type library from which the type was imported.
Public enumerationTypeLibVarFlags Describes the original settings of the VARFLAGS in the COM type library from which the variable was imported.
Public enumerationUnmanagedType Identifies how to marshal parameters or fields to unmanaged code.
Public enumerationVarEnum Indicates how to marshal the array elements when an array is marshaled from managed to unmanaged code as a UnmanagedType..::.SafeArray.
Public enumerationVARFLAGS Obsolete. Use System.Runtime.InteropServices.ComTypes..::.VARFLAGS instead.
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker