FieldInfo.IsPinvokeImpl Property


The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

Gets a value indicating whether the corresponding PinvokeImpl attribute is set in FieldAttributes.

Namespace:   System.Reflection
Assembly:  mscorlib (in mscorlib.dll)

Public ReadOnly Property IsPinvokeImpl As Boolean

Property Value

Type: System.Boolean

true if the PinvokeImpl attribute is set in FieldAttributes; otherwise, false.

The following example creates a class and displays the name, field and IsPinvokeImpl property value of the field.

Imports System
Imports System.Reflection
Imports Microsoft.VisualBasic

Public Class Fieldinfo_IsPinvoke
    Public myField As String = "A public field"

    Public Shared Sub Main()
        Dim myObject As New Fieldinfo_IsPinvoke()

        ' Get the Type and FieldInfo.
        Dim myType1 As Type = GetType(Fieldinfo_IsPinvoke)
        Dim myFieldInfo As FieldInfo = myType1.GetField("myField", _
           BindingFlags.Public Or BindingFlags.Instance)

        ' Display the name, field and the PInvokeImpl attribute for the field.
        Console.Write(ControlChars.NewLine & "Name of class: {0}", _
        Console.Write(ControlChars.NewLine & "Value of field: {0}", _
        Console.Write(ControlChars.NewLine & "IsPinvokeImpl: {0}", _
    End Sub
End Class

.NET Framework
Available since 1.1
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Return to top