Marshal.GetMethodInfoForComSlot(Type, Int32, ComMemberType) Metodo

Definizione

Recupera un oggetto MemberInfo per lo slot della tabella di funzione virtuale specificata (V-Table o VTBL).

public:
 static System::Reflection::MemberInfo ^ GetMethodInfoForComSlot(Type ^ t, int slot, System::Runtime::InteropServices::ComMemberType % memberType);
public static System.Reflection.MemberInfo GetMethodInfoForComSlot (Type t, int slot, ref System.Runtime.InteropServices.ComMemberType memberType);
[System.Security.SecurityCritical]
public static System.Reflection.MemberInfo GetMethodInfoForComSlot (Type t, int slot, ref System.Runtime.InteropServices.ComMemberType memberType);
static member GetMethodInfoForComSlot : Type * int * ComMemberType -> System.Reflection.MemberInfo
[<System.Security.SecurityCritical>]
static member GetMethodInfoForComSlot : Type * int * ComMemberType -> System.Reflection.MemberInfo
Public Shared Function GetMethodInfoForComSlot (t As Type, slot As Integer, ByRef memberType As ComMemberType) As MemberInfo

Parametri

t
Type

Tipo per il quale recuperare MemberInfo.

slot
Int32

Slot VTBL.

memberType
ComMemberType

A corretto completamento, uno dei valori di enumerazione che specifica il tipo del membro.

Restituisce

Oggetto che rappresenta il membro nello slot VTBL specificato.

Attributi

Eccezioni

t non è visibile da COM.

Commenti

Il valore restituito può essere un FieldInfooggetto , MethodInfoo PropertyInfo . Il valore restituito dipende dal tipo di membro gestito presente nello slot COM specificato(quindi il tipo MemberInfo restituito generalizzato da cui derivano tutti e tre).

Numero di slot in base zero restituito da questo metodo per tre metodi IUnknown e possibilmente quattro metodi IDispatch , rendendo il valore del primo slot disponibile 3 o 7. GetMethodInfoForComSlot fornisce la funzionalità opposta di Marshal.GetComSlotForMethodInfo. È possibile usare Marshal.GetEndComSlot e Marshal.GetStartComSlot in combinazione con GetMethodInfoForComSlot per passare slot all'interno di un intervallo specificato.

Il memberType parametro è importante solo in caso di restituzione. Contiene il tipo del membro COM (un metodo regolare o una funzione di accesso di proprietà) che corrisponde all'oggetto restituito MemberInfo .

Si applica a

Vedi anche