Partager via


CallingConvention Enumeration

Microsoft Silverlight will reach end of support after October 2021. Learn more.

This API supports the .NET Framework infrastructure and is not intended to be used directly from your code.

Specifies the calling convention required to call methods implemented in unmanaged code.

Namespace:  System.Runtime.InteropServices
Assembly:  mscorlib (in mscorlib.dll)

Syntax

'Declaration
<ComVisibleAttribute(True)> _
Public Enumeration CallingConvention
[ComVisibleAttribute(true)]
public enum CallingConvention

Members

Member name Description
Supported by Silverlight for Windows PhoneSupported by Xbox 360 Winapi This member is not actually a calling convention, but instead uses the default platform calling convention. For example, on Windows the default is StdCall and on Windows CE.NET it is Cdecl.
Supported by Silverlight for Windows PhoneSupported by Xbox 360 Cdecl The caller cleans the stack. This enables calling functions with varargs, which makes it appropriate to use for methods that accept a variable number of parameters, such as Printf.
Supported by Silverlight for Windows PhoneSupported by Xbox 360 StdCall The callee cleans the stack. This is the default convention for calling unmanaged functions with platform invoke.
Supported by Silverlight for Windows PhoneSupported by Xbox 360 ThisCall The first parameter is the this pointer and is stored in register ECX. Other parameters are pushed on the stack. This calling convention is used to call methods on classes exported from an unmanaged DLL.
Supported by Silverlight for Windows PhoneSupported by Xbox 360 FastCall This calling convention is not supported.

Version Information

Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

XNA Framework

Supported in: Xbox 360, Windows Phone OS 7.0

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.