NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

System.Runtime.InteropServices Namespace

Classes

Class Description
CallConvCdecl [To be supplied.]
CallConvFastcall [To be supplied.]
CallConvStdcall [To be supplied.]
CallConvThiscall [To be supplied.]
ComAliasNameAttribute Applied to a parameter or field to indicate the COM alias for the parameter or field type.
ComConversionLossAttribute [To be supplied.]
ComEmulateAttribute Use this attribute on a class to indicate that the class is an emulator class for another NGWS class. The emulator class acts as a proxy for managed types that supportnstances of the emulator class are activated via COM's CoCreateInstance API. This include instances created from managed clients which always interact with the emulator class through COM Interop.

Refer to

COMEmulateException [To be supplied.]
COMException Represents the exception that is thrown when there is a COM Interop error.
ComImportAttribute A Pseudo attribute used to indicate that a class or interface definition was imported from a COM type library. The runtime uses this flag to know how to activate and marshal the type.
ComRegisterFunctionAttribute Use this attribute on a method to indicate that the method should be called when the assembly is registered for use from COM. This allows user written code to be executed during the registraton process. Methods with this attrubte must be static and must take a single string parameter for the name of the registry key being updated. If and when the assembly containing the method is registered with the RegAsm tool, this method is called by the runtime. If the assembly containing the method is not registered. the method is not called. If the types within the assembly were not intented to be used from com, the assembly will typically not be registered. The registry key being updated such as "HKEY_CLASSES_ROOT\CLSID\<clsid>" is passed to the method. Each assembly can have only one registration function, at most.

If a registration method is provided, users shoudl be sure to "undo" when the registration did in the unregistration function.

ComSourceInterfacesAttribute Identifies the list of interfaces that are sources of events for the class. The string value consists of a a null reference (in Visual Basic Nothing) delimited list of interface names. See the com interop spec for additional details
ComUnregisterFunctionAttribute Use this attribute on a method to indicate that the method should be called when the assembly is unregistered for use from COM. This allows user written code to be executed during the unregistraton process. Methods with this attrubte must be static and must take a single string parameter for the name of the registry key being updated. If and when the assembly containing the method is unregistered with the RegAsm tool, this method is called by the runtime. If the assembly containing the method is not unregistered. the method is not called. If the types within the assembly were not intented to be used from com, the assembly will typically not be registered. The registry key being updated such as "HKEY_CLASSES_ROOT\CLSID\<clsid>" is passed to the method. Each assembly can have only one unregistration function, at most.

If a unregistration method is provided, it should be sure to "undo" when the registration function did.

ComVisibleAttribute This attribute can be applied to an individual type or to an entire assembly to control COM visibility. To make types visible to COM set the attribute to true. To hide types from COM, set the attribute to false. By default, all managed types that are public are visible (the attribute is not needed to make them visible). Setting the attribute to false on the assembly hides all public types within the assembly. Setting the attribute to false on a specific type hides that specific type. Settings applied to an individual type override any assembly settings. Therefore, setting the attribute to false on the assembly and true on an individual type will cause only that type to be visible from the assembly. Only types that are public can be made visible. The attribute cannot be used to make a private or protected type visible to COM.
DispIdAttribute Custom attribute to specify the COM DISPID of a Method or Field.

This attribute contains the dispid for the method, field or property it describes. Unique Dispids are typically assigned by the runtime but this attribute can be used to force a specific method to have a specific dispid.

When methods with this attribute are exposed through IDispatch, they are exposed with the dispid specified in the attribute. When importing a typelib, this attribute is applied to all methods with assigned dispids. This ensures that the any managed implementation of the same method would retain the same dispid if exposed to com.

DllImportAttribute Used to indicate that a method in P/Invoke method implemented in unmanaged code. The attribute provides the name of the file (DllName) and the name of the method within that file (EntryPoint) where the implementation can be found.
ExposeHResultAttribute Deprecated. USe PreserveSigAttribute instead.
ExtensibleClassFactory Provides methods used to customize the creation of managed objects that extend from unmanaged objects.
ExternalException Represents COM Interop errors and SEH exceptions.
FieldOffsetAttribute Used along with the System.Runtime.InteropServices.StructLayoutAttribute.LayoutKind set to Explicit to indicate he physical position of each field within a class.
GlobalObjectAttribute Deprecated. Do not use
GuidAttribute Used to supply the GUID of a class, interface or an entire type library. The string passed to the attribute must be a format that is an acceptable constructor argument for the type Guid. To avoid conflicts with the type Guid the long name "GuidAttribute" should be used explicitly.
HasDefaultInterfaceAttribute Custom attribute to specify that a class has a COM default interface.

This custom attribute indicates that the class has an explicit default interface. If the custom attribute is present, the first Interface implementation supplied when the type was defined is assumed to be the default interface for the class. If a custom value is missing, the default interface is assumed to be the class interface for the class. See the Interop Spec for important details.

IDispatchImplAttribute  
ImportedFromTypeLibAttribute Custom attribute to specify that a module is imported from a COM type library.

This attribute indicates that the module was originally imported from a COM type library. The primary use of the attribute is to ensure that the module is not subsequently re-exported to COM thereby causing duplicate type definitions. This should not be confused with the ComImportAttribute, which is used on a type to indicate that the individual type is implemented in COM.

InAttribute Used on a parameter or field to indicate that data should be marshaled in to the caller.
InterfaceTypeAttribute Controls how a managed interface is exposed to COM clients (IDispatch derived or IUnknown derived).

This attribute indicates whether a managed interface is Dual, IDispatch or IUnknown based when exposed to COM. If the attrigute is missing the interface is exposed to COM as a Dual interface.

InvalidComObjectException Represents the exception that is thrown when an invalid COM object is used.
InvalidOleVariantTypeException [To be supplied.]
Marshal PInvoke (Platform Invocation Services) lets you execute existing, unmanaged code, that lives in a regular DLL, from managed code.
MarshalAsAttribute This attribute is used on fields or parameters to indicate how the data should be marshaled between managed and unmanaged code. The attribute is always optional as each data type has default marshaling behavior. The attribute is only necessary when a given type can be marshaled to a number of other possible types. For example, a String could be marshaled to unmanaged code as either a LPSTR, LPWSTR, LPTSTR or as a BSTR. By default the string would be marshaled as a BSTR. The MarshalAsAttribute can be applied to an individual field or parameter to cause that particular string to be marshaled as a LPSTR instead of a BSTR. For complete details on using this attribute see the data type marshaling spec.
MethodImplAttribute [To be supplied.]
NoComRegistrationAttribute Use this attribute to indicate that an otherwise public, COM-creatable type shuld not be registered for use form com applications.
NoIDispatchAttribute This attribute is used to control how the class responds to queries for an IDispatch Interface. If the attribute is present, all calls to QueryInterface that request IID_IDispatch will return E_NOINTERFACE. If the attribute is missing, the class will respond to queries for IID_IDispatch by returning either the class interface or the interface that is explicitly marked as the class's default interface. For details on selecting the default interface see the HasDefaultInterfaceAttribute.
OutAttribute Used on a parameter or field to indicate that data should be marshaled out from callee back to caller.
PredeclaredAttribute Deprecated. Do not use
PreserveSigAttribute Used to indicate that HResult/retval signature transformation that normally takes place during Interop calls should be suppressed. The attribute affects marshaling as well as type library importing and exporting.
ProgIdAttribute Custom attribute that allows the user to specify the prog ID of a NGWS class.
RegistrationServices [To be supplied.]
Root This class allows you to create an opaque, 32-bit root handle to any managed object. A root handle prevents that 'rooted' managed object from being reclaimed by garbage collection, so that a reference to the managed object can be safely stored in native data structures.
SafeArrayTypeMismatchException [To be supplied.]
SEHException Represents Structured Exception Handler (SEH) errors.
StructLayoutAttribute Typically the runtime controls the physical layout of the data members of class. The StructLayoutAttribute allows the user to control the physical layout of the data members of a class. Explicit control of a classes layout is important if the class is to be passed to unmanaged code that expects a specific layout. The LayoutKind value Sequential is used to force the members to be laid out sequentially in the order they appear. Explicit is used to control the precise position of each data member. With Explicit each member must use the FieldOffsetAttribute to indicate the position of that field within the type.
TypeAttr [To be supplied.]
TypeLibAttr [To be supplied.]
TypeLibConverter [To be supplied.]
TypeLibFuncAttribute Contains the FUNCFLAGS that were originally imported for this function from the COM type library.
TypeLibTypeAttribute Contains the TYPEFLAGS that were originally imported for this type from the COM type library.
TypeLibVarAttribute Contains the VARFLAGS that were originally imported for this variable from the COM type library.
VTableCallsNotSupportedException [To be supplied.]

Interfaces

Interface Description
ICustomMarshaler [To be supplied.]
ITypeLibConverter [To be supplied.]
ITypeLibExporterNotifySink [To be supplied.]
ITypeLibImporterNotifySink [To be supplied.]
UCOMIConnectionPoint Used by the custom connection point marshaler that the NGWS runtime provides.
UCOMIConnectionPointContainer UCOMIConnectionPointContainer interface definition.
UCOMIEnumVARIANT [To be supplied.]
UCOMITypeInfo [To be supplied.]
UCOMITypeLib [To be supplied.]

Structures

Structure Description
ArrayWithOffset Encapsulates a combination of an array and an offset within that array. When used as an argument to a native method, reached via Platform Invoke, the PInvoke marshaler will fetch the base address of the array, add the offset, and pass the resulting pointer to the underlying native function.
GCHandle This class allows you to create an opaque, GC handle to any NGWS object. A GC handle is used when an object reference must be reachable from unmanaged memory. See GCHandleType for more information about the different types of GCHandles used by the Runtime Execution Engine.
IDLDesc [To be supplied.]
TypeDesc [To be supplied.]

Delegates

Delegate Description
ObjectCreationDelegate Creates a COM object.

Enumerations

Enumeration Description
CallingConvention [To be supplied.]
CharSet [To be supplied.]
ComInterfaceType This enumeration is used with the InterfaceTypeAttribute to identify how an interface should be exposed to COM.
ExporterEventKind [To be supplied.]
GCHandleType This enum represents the the 4 different types of GCHandlesthat can be allocated by the GCHandle class. The type of handles are Normal, Weak, WeakTrackResurrection and Pinned
IDispatchImplType [To be supplied.]
ImporterEventKind [To be supplied.]
LayoutKind [To be supplied.]
LIBFLAGS [To be supplied.]
MethodImplOptions [To be supplied.]
PInvokeMap Defines the PInvoke attributes. These values are defined in CorHdr.h.
SYSKIND [To be supplied.]
TYPEFLAGS [To be supplied.]
TYPEKIND [To be supplied.]
TypeLibFuncFlags Describes the original settings of the FUNCFLAGS in the COM type library from where this method was imported.
TypeLibTypeFlags Describes the original settings of the TYPEFLAGS in the COM type library from which the type was imported.
TypeLibVarFlags Describes the original settings of the VARFLAGS in the COM type library from which the variable was imported.
UnmanagedType Identifies how parameters or fields should be marshaled to unmanaged code.
VarEnum [To be supplied.]