mscorlib 2.0.0.0 4.0.0.0 System.Attribute System.AttributeUsage(System.AttributeTargets.Delegate, AllowMultiple=false, Inherited=false) System.Runtime.InteropServices.ComVisible(true)

The fields of the attribute control various aspects of the transition of a delegate to an unmanaged function pointer, and are the same as the fields with identical names in the attribute. These fields are optional, but if you do not specify a field name, is ignored.

For more information about using attributes, see Extending Metadata Using Attributes.

Controls the marshaling behavior of a delegate signature passed as an unmanaged function pointer to or from unmanaged code. This class cannot be inherited.

- Constructor
  2.0.0.0
  4.0.0.0

  This method specifies the calling convention for the delegate in unmanaged code and is the most common use of the attribute. You can set the parameter to one of the values in the enumeration.

  Initializes a new instance of the class with the specified calling convention.

  The specified calling convention.
- Field
  2.0.0.0
  4.0.0.0
  System.Boolean

  The field is true by default, which means that best-fit mapping behavior is enabled. If the field is false, best-fit mapping is disabled. Settings for this field override any level settings for the attribute.

  For more information, see .

  Enables or disables best-fit mapping behavior when converting Unicode characters to ANSI characters.

- Property
  2.0.0.0
  4.0.0.0
  System.Runtime.InteropServices.CallingConvention To be added. To be added.

  Gets the value of the calling convention.

- Field
  2.0.0.0
  4.0.0.0
  System.Runtime.InteropServices.CharSet

  Use this field with a member of the enumeration to specify the marshaling behavior of string parameters and to specify which entry-point name to invoke (the exact name given or a name ending with "A" or "W").

  For more information, see .

  Indicates how to marshal string parameters to the method, and controls name mangling.

- Field
  2.0.0.0
  4.0.0.0
  System.Boolean

  The field is false by default, which means the caller calls SetLastError. Set this field to true to indicate that the callee calls SetLastError before returning from the attributed method.

  For more information, see .

  Indicates whether the callee calls the SetLastError Win32 API function before returning from the attributed method.

- Field
  2.0.0.0
  4.0.0.0
  System.Boolean

  The field is false by default, which means that the field is disabled. Set this field to true to indicate that an exception is thrown each time the interop marshaler converts an unmappable character.

  For more information, see .

  Enables or disables the throwing of an exception on an unmappable Unicode character that is converted to an ANSI "?" character.