IDebugCustomViewer::DisplayValueIDebugCustomViewer::DisplayValue

呼叫這個方法來顯示指定的值。This method is called to display the specified value.

語法Syntax

HRESULT DisplayValue(
   HWND             hwnd,
   DWORD            dwID,
   IUnknown *       pHostServices,
   IDebugProperty3* pDebugProperty);
);
int DisplayValue(
   IntPtr          hwnd,
   uint            dwID,
   object          pHostServices,
   IDebugProperty3 pDebugProperty
);

參數Parameters

hwnd
在父視窗[in] Parent window

dwID
在支援多個類型之自訂檢視器的識別碼。[in] ID for custom viewers that support more than one type.

pHostServices
[in] 保留。[in] Reserved. 一律設為 null。Always set to null.

pDebugProperty
在介面,可用來取得要顯示的值。[in] Interface that can be used to retrieve the value to be displayed.

傳回值Return Value

如果成功,則傳回,否則會傳回 S_OK 錯誤碼。If successful, returns S_OK; otherwise returns error code.

備註Remarks

顯示為「強制回應」,這個方法將會建立必要的視窗、顯示值、等候輸入,以及關閉視窗,然後再返回呼叫端。The display is "modal" in that this method will create the necessary window, display the value, wait for input, and close the window, all before returning to the caller. 這表示此方法必須處理顯示內容值的所有層面,從建立輸出視窗到等候使用者輸入,到終結視窗。This means the method must handle all aspects of displaying the property's value, from creating a window for output, to waiting for user input, to destroying the window.

若要支援變更指定之 IDebugProperty3 物件的值,您可以使用 SetValueAsStringWithError 方法(如果值可以表示為字串)。To support changing the value on the given IDebugProperty3 object, you can use the SetValueAsStringWithError method —if the value can be expressed as a string. 否則,您必須 DisplayValue 在相同的物件上建立自訂介面,此介面是執行此方法的運算式評估工具所特有 IDebugProperty3Otherwise, it is necessary to create a custom interface—exclusive to the expression evaluator implementing this DisplayValue method—on the same object that implements the IDebugProperty3 interface. 這個自訂介面會提供方法來變更任意大小或複雜度的資料。This custom interface would supply methods for changing the data of an arbitrary size or complexity.

另請參閱See also