ICorDebugEval2::CallParameterizedFunction 方法ICorDebugEval2::CallParameterizedFunction Method

設定指定之 ICorDebugFunction 的呼叫,此呼叫可以嵌套在其函式採用參數的類別內 Type ,或本身可以接受 Type 參數。Sets up a call to the specified ICorDebugFunction, which can be nested inside a class whose constructor takes Type parameters, or can itself take Type parameters.

語法Syntax

HRESULT CallParameterizedFunction (  
    [in] ICorDebugFunction     *pFunction,  
    [in] ULONG32               nTypeArgs,  
    [in, size_is(nTypeArgs)] ICorDebugType *ppTypeArgs[],  
    [in] ULONG32               nArgs,  
    [in, size_is(nArgs)] ICorDebugValue *ppArgs[]  
);  

參數Parameters

pFunction
ICorDebugFunction 物件的指標,代表要呼叫的函式。[in] A pointer to an ICorDebugFunction object that represents the function to be called.

nTypeArgs
在函數所採用的引數數目。[in] The number of arguments that the function takes.

ppTypeArgs
在指標的陣列,每個指標都會指向表示函式引數的 ICorDebugType 物件。[in] An array of pointers, each of which points to an ICorDebugType object that represents a function argument.

nArgs
在函數中傳遞的值數目。[in] The number of values passed in the function.

ppArgs
在指標的陣列,每個指標都會指向表示函式引數中傳遞之值的 ICorDebugValue 物件。[in] An array of pointers, each of which points to an ICorDebugValue object that represents a value passed in a function argument.

備註Remarks

CallParameterizedFunction 類似于 ICorDebugEval:: CallFunction ,不同之處在于函式可能在具有型別參數的類別內、本身可以採用型別參數或兩者。CallParameterizedFunction is like ICorDebugEval::CallFunction except that the function may be inside a class with type parameters, may itself take type parameters, or both. 應先為類別指定型別引數,然後為函式提供型別引數。The type arguments should be given first for the class, and then for the function.

如果函式在不同的應用程式域中,就會發生轉換。If the function is in a different application domain, a transition will occur. 但是,所有型別和值引數都必須在目標應用程式域中。However, all type and value arguments must be in the target application domain.

函數評估只能在有限的情況下執行。Function evaluation can be performed only in limited scenarios. 如果 CallParameterizedFunctionICorDebugEval::CallFunction 失敗,傳回的 HRESULT 將會指出失敗的最普遍可能原因。If CallParameterizedFunction or ICorDebugEval::CallFunction fails, the returned HRESULT will indicate the most general possible reason for failure.

規格需求Requirements

平台: 請參閱 系統需求Platforms: See System Requirements.

標頭: CorDebug.idl、CorDebug.hHeader: CorDebug.idl, CorDebug.h

程式庫: CorGuids.libLibrary: CorGuids.lib

.NET Framework 版本:自 2.0 起可用Available since 2.0.NET Framework Versions: 自 2.0 起可用Available since 2.0