_MethodBase.Invoke Metodo
Definizione
Overload
Invoke(Object, Object[]) |
Fornisce oggetti COM con accesso indipendente dalla versione al metodo Invoke(Object, Object[]).Provides COM objects with version-independent access to the Invoke(Object, Object[]) method. |
Invoke(Object, BindingFlags, Binder, Object[], CultureInfo) |
Fornisce oggetti COM con accesso indipendente dalla versione al metodo Invoke(Object, BindingFlags, Binder, Object[], CultureInfo).Provides COM objects with version-independent access to the Invoke(Object, BindingFlags, Binder, Object[], CultureInfo) method. |
Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr) |
Fornisce l'accesso a proprietà e metodi esposti da un oggetto.Provides access to properties and methods exposed by an object. |
Commenti
Questo metodo consente l'accesso alle classi gestite da codice non gestito e non deve essere chiamato dal codice gestito.This method is for access to managed classes from unmanaged code and should not be called from managed code.
I Invoke metodi richiamano il costruttore riflesso dall'istanza che ha i parametri specificati.The Invoke methods invoke the constructor reflected by the instance that has the specified parameters.
Invoke(Object, Object[])
Fornisce oggetti COM con accesso indipendente dalla versione al metodo Invoke(Object, Object[]).Provides COM objects with version-independent access to the Invoke(Object, Object[]) method.
public:
System::Object ^ Invoke(System::Object ^ obj, cli::array <System::Object ^> ^ parameters);
public object Invoke (object obj, object[] parameters);
abstract member Invoke : obj * obj[] -> obj
Public Function Invoke (obj As Object, parameters As Object()) As Object
Parametri
- obj
- Object
Istanza che ha creato questo metodo.The instance that created this method.
- parameters
- Object[]
Elenco di argomenti per il metodo o il costruttore richiamato.An argument list for the invoked method or constructor. È costituito da una matrice di oggetti con lo stesso numero, ordine e tipo dei parametri del metodo o del costruttore da richiamare.This is an array of objects with the same number, order, and type as the parameters of the method or constructor to be invoked. In assenza di parametri, parameters
deve essere null
.If there are no parameters, parameters
should be null
.
Se il metodo o il costruttore rappresentato da questa istanza accetta un parametro ref
, o ByRef
in Visual Studio, non sono richiesti attributi speciali per tale parametro per poter richiamare il metodo o il costruttore tramite la funzione.If the method or constructor represented by this instance takes a ref
parameter (ByRef
in Visual Basic), no special attribute is required for that parameter to invoke the method or constructor using this function. Qualsiasi oggetto in questa matrice non inizializzato in modo esplicito con un valore conterrà il valore predefinito per quel tipo di oggetto.Any object in this array that is not explicitly initialized with a value will contain the default value for that object type. Per gli elementi di tipo riferimento, questo valore è null
.For reference type elements, this value is null
. Per gli elementi di tipo valore, questo valore è 0, 0.0 o false
, a seconda del tipo di elemento specifico.For value type elements, this value is 0, 0.0, or false
, depending on the specific element type.
Restituisce
Istanza della classe associata al costruttore.An instance of the class associated with the constructor.
Commenti
Questo metodo consente l'accesso alle classi gestite da codice non gestito e non deve essere chiamato dal codice gestito.This method is for access to managed classes from unmanaged code and should not be called from managed code.
Il Invoke metodo richiama il metodo o il costruttore rappresentato da questo oggetto, usando i parametri specificati.The Invoke method invokes the method or constructor represented by this object, using the specified parameters.
Invoke(Object, BindingFlags, Binder, Object[], CultureInfo)
Fornisce oggetti COM con accesso indipendente dalla versione al metodo Invoke(Object, BindingFlags, Binder, Object[], CultureInfo).Provides COM objects with version-independent access to the Invoke(Object, BindingFlags, Binder, Object[], CultureInfo) method.
public:
System::Object ^ Invoke(System::Object ^ obj, System::Reflection::BindingFlags invokeAttr, System::Reflection::Binder ^ binder, cli::array <System::Object ^> ^ parameters, System::Globalization::CultureInfo ^ culture);
public object Invoke (object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, object[] parameters, System.Globalization.CultureInfo culture);
abstract member Invoke : obj * System.Reflection.BindingFlags * System.Reflection.Binder * obj[] * System.Globalization.CultureInfo -> obj
Parametri
- obj
- Object
Istanza che ha creato questo metodo.The instance that created this method.
- invokeAttr
- BindingFlags
Uno dei valori di BindingFlags
che specifica il tipo di associazione.One of the BindingFlags
values that specifies the type of binding.
- binder
- Binder
Oggetto Binder
che definisce un insieme di proprietà e attiva l'associazione, l'assegnazione forzata dei tipi di argomento e la chiamata dei membri tramite reflection.A Binder
that defines a set of properties and enables the binding, coercion of argument types, and invocation of members using reflection. Se binder
è null
, viene utilizzato Binder.DefaultBinding
.If binder
is null
, then Binder.DefaultBinding
is used.
- parameters
- Object[]
Matrice di tipo Object
utilizzata per trovare la corrispondenza di numero, ordine e tipo dei parametri per questo costruttore, in base ai vincoli dell'oggetto binder
.An array of type Object
used to match the number, order, and type of the parameters for this constructor, under the constraints of binder
. Se questo costruttore non richiede parametri, passare una matrice con zero elementi, come in Object[] parameters = new Object[0]
.If this constructor does not require parameters, pass an array with zero elements, as in Object[] parameters = new Object[0]
. Qualsiasi oggetto in questa matrice non inizializzato in modo esplicito con un valore conterrà il valore predefinito per quel tipo di oggetto.Any object in this array that is not explicitly initialized with a value will contain the default value for that object type. Per gli elementi di tipo riferimento, questo valore è null
.For reference type elements, this value is null
. Per gli elementi di tipo valore, questo valore è 0, 0.0 o false
, a seconda del tipo di elemento specifico.For value type elements, this value is 0, 0.0, or false
, depending on the specific element type.
- culture
- CultureInfo
Oggetto CultureInfo utilizzato per gestire la coercizione dei tipi.A CultureInfo object used to govern the coercion of types. Se è null
, per il thread corrente verrà usato l'oggetto CultureInfo.If this is null
, the CultureInfo for the current thread is used.
Restituisce
Istanza della classe associata al costruttore.An instance of the class associated with the constructor.
Commenti
Questo metodo consente l'accesso alle classi gestite da codice non gestito e non deve essere chiamato dal codice gestito.This method is for access to managed classes from unmanaged code and should not be called from managed code.
Il Invoke metodo richiama il costruttore riflesso da questo ConstructorInfo oggetto con gli argomenti specificati, in base ai vincoli dell'oggetto specificato Binder .The Invoke method invokes the constructor reflected by this ConstructorInfo object with the specified arguments, under the constraints of the specified Binder object.
Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr)
Fornisce l'accesso a proprietà e metodi esposti da un oggetto.Provides access to properties and methods exposed by an object.
public:
void Invoke(System::UInt32 dispIdMember, Guid % riid, System::UInt32 lcid, short wFlags, IntPtr pDispParams, IntPtr pVarResult, IntPtr pExcepInfo, IntPtr puArgErr);
public void Invoke (uint dispIdMember, ref Guid riid, uint lcid, short wFlags, IntPtr pDispParams, IntPtr pVarResult, IntPtr pExcepInfo, IntPtr puArgErr);
abstract member Invoke : uint32 * Guid * uint32 * int16 * nativeint * nativeint * nativeint * nativeint -> unit
Public Sub Invoke (dispIdMember As UInteger, ByRef riid As Guid, lcid As UInteger, wFlags As Short, pDispParams As IntPtr, pVarResult As IntPtr, pExcepInfo As IntPtr, puArgErr As IntPtr)
Parametri
- dispIdMember
- UInt32
Identificatore per il membro.An identifier for the member.
- riid
- Guid
Riservato per usi futuri.Reserved for future use. Deve essere IID_NULL.Must be IID_NULL.
- lcid
- UInt32
Contesto di impostazioni locali all'interno del quale devono essere interpretati gli argomenti.The locale context in which to interpret arguments.
- wFlags
- Int16
Flag che descrivono il contesto della chiamata.Flags describing the context of the call.
- pDispParams
- IntPtr
Puntatore a una struttura contenente una matrice di argomenti, una matrice di DISPID per argomenti denominati e i conteggi del numero di elementi nelle matrici.A pointer to a structure containing an array of arguments, an array of argument DISPIDs for named arguments, and counts for the number of elements in the arrays.
- pVarResult
- IntPtr
Puntatore al percorso in cui verrà archiviato il risultato.A pointer to the location where the result will be stored.
- pExcepInfo
- IntPtr
Puntatore a una struttura contenente informazioni sulle eccezioni.A pointer to a structure that contains exception information.
- puArgErr
- IntPtr
Indice del primo argomento che contiene un errore.The index of the first argument that has an error.
Commenti
Questo metodo consente l'accesso alle classi gestite da codice non gestito e non deve essere chiamato dal codice gestito.This method is for access to managed classes from unmanaged code and should not be called from managed code. Per ulteriori informazioni su IDispatch::Invoke
, vedere MSDN Library.For more information about IDispatch::Invoke
, see the MSDN Library.