The fields of the DllImportAttribute class are listed below. For a complete list of DllImportAttribute class members, see the DllImportAttribute Members topic.
CallingConvention | Set to indicate the calling convention used in passing method arguments. See calling conventions in MSDN for details on each. The default is the CallingConvention value StdCall. |
CharSet | Indicates how string arguments to the method should be marshaled. This field is set to one of the CharSet values. If the CharSet field is set to Unicode, all string arguments are converted to Unicode characters before being passed to the unmanaged implementation. If the field is set to Ansi, the strings are converted to ANSI strings first. If the CharSet is set to Auto, the conversion is platform dependent (Unicode on WinNT and ANSI on Win 9x). Auto is only supported through PInvoke. |
EntryPoint | Indicates the name or ordinal of the dll entry point to be called. |
ExactSpelling | Set to true to indicate that the name of the entry point in the unmanaged dll should not be modified to correspond to the CharSet value specified in the CharSet field. If the field is not set, the letter A is appended to the method name when Ansi is used and the letter W is appended to the method name when Unicode is used. The default is false. |
SetLastError | Set to true to indicate that the caller may call GetLastError to determine if an error occurred while executing the method. The default is false. |
TransformSig | Set to true to indicate that the managed method signature should be transformed into a unmanaged signature that returns an HResult and has an additional out retval argument for the return value. See the COM Interop spec for details. The default is false. |
DllImportAttribute Class | System.Runtime.InteropServices Namespace