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!

PreserveSigAttribute Class

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.

Object
   Attribute
      PreserveSigAttribute

[Visual Basic]
Public Class PreserveSigAttribute
   Inherits Attribute
[C#]
public class PreserveSigAttribute : Attribute
[C++]
public __gc class PreserveSigAttribute : public Attribute
[JScript]
public class PreserveSigAttribute extends Attribute

Remarks

Can be used to attribute methods.

Requirements

Namespace: System.Runtime.InteropServices

Assembly: mscorlib.dll

Example [C#]

The following managed method:

[C#]

int DoSomething (long l);

Is normally converted to:

[C#]

HRESULT DoSomething ([in] long l, [out retval] int * I);

When exported to a type library. When the PreserveSignatureAttribute is applied to the method:

[C#]

[PreserveSig] Int DoSomething (long l);

The method is exported to the type library as is:

[C#]

int DoSomething ([in] long l);

See Also

PreserveSigAttribute Members | System.Runtime.InteropServices Namespace