Marshal.GetMethodInfoForComSlot(Type, Int32, ComMemberType) Metodo

Definizione

Recupera un MemberInfo oggetto per lo slot v-table o VTBL (Virtual Function Table) specificato.

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 deve essere recuperato l'oggetto MemberInfo .

slot
Int32

Slot VTBL.

memberType
ComMemberType

In caso di esito positivo, uno dei valori di enumerazione che specifica il tipo del membro.

Valori restituiti

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 (da cui deriva il tipo MemberInfo restituito generalizzato da cui derivano tutte e tre).

Il numero di slot in base zero restituito da questo metodo rappresenta 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 gli 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 alla proprietà) che corrisponde all'oggetto restituito MemberInfo .

Si applica a

Vedi anche