|
2 | 2 | title: "IDebugExpressionEvaluator2::SetCallback | Microsoft Docs"
|
3 | 3 | ms.date: "11/04/2016"
|
4 | 4 | ms.topic: "conceptual"
|
5 |
| -helpviewer_keywords: |
| 5 | +helpviewer_keywords: |
6 | 6 | - "IDebugExpressionEvaluator2::SetCallback"
|
7 | 7 | - "SetCallback"
|
8 | 8 | ms.assetid: 31e3a99e-e784-44a3-8b19-cc5ef31ed546
|
9 | 9 | author: "gregvanl"
|
10 | 10 | ms.author: "gregvanl"
|
11 | 11 | manager: jillfra
|
12 |
| -ms.workload: |
| 12 | +ms.workload: |
13 | 13 | - "vssdk"
|
14 | 14 | ---
|
15 | 15 | # IDebugExpressionEvaluator2::SetCallback
|
16 |
| -Enables the expression evaluator (EE) to specify the callback interface that the debugger engine (DE) will use to read metric settings. |
17 |
| - |
18 |
| -## Syntax |
19 |
| - |
20 |
| -```cpp |
21 |
| -HRESULT SetCallback ( |
22 |
| - IDebugSettingsCallback2* pCallback |
23 |
| -); |
24 |
| -``` |
25 |
| - |
26 |
| -```csharp |
27 |
| -int SetCallback ( |
28 |
| - IDebugSettingsCallback2 pCallback |
29 |
| -); |
30 |
| -``` |
31 |
| - |
32 |
| -#### Parameters |
33 |
| - `pCallback` |
34 |
| - [in] Interface to use for the settings callback. |
35 |
| - |
36 |
| -## Return Value |
37 |
| - If successful, returns `S_OK`; otherwise, returns an error code. |
38 |
| - |
39 |
| -## Remarks |
40 |
| - This method provides an interface to the session debug manager that an expression evaluator can use to read metric settings. It is useful in remote debugging to read metrics on the [!INCLUDE[vsprvs](../../../code-quality/includes/vsprvs_md.md)] computer. |
41 |
| - |
42 |
| -## Example |
43 |
| - The following examples shows how to implement this method for a **CEE** object that exposes the [IDebugSettingsCallback2](../../../extensibility/debugger/reference/idebugsettingscallback2.md) interface. |
44 |
| - |
45 |
| -```cpp |
46 |
| -HRESULT CEE::SetCallback(IDebugSettingsCallback2* in_pCallback) |
47 |
| -{ |
48 |
| - // precondition |
49 |
| - INVARIANT( this ); |
50 |
| - |
51 |
| - // function body |
52 |
| - if (NULL != this->m_LanguageSpecificUseCases.pfSetCallback) |
53 |
| - { |
54 |
| - EEDomain::fSetCallback DomainVal = |
55 |
| - { |
56 |
| - in_pCallback |
57 |
| - }; |
58 |
| - |
59 |
| - BOOL bSuccess = (*this->m_LanguageSpecificUseCases.pfSetCallback)(DomainVal); |
60 |
| - ENSURE( bSuccess ); |
61 |
| - } |
62 |
| - |
63 |
| - // postcondition |
64 |
| - INVARIANT( this ); |
65 |
| - |
66 |
| - return S_OK; |
67 |
| -} |
68 |
| -``` |
69 |
| - |
70 |
| -## See Also |
71 |
| - [IDebugExpressionEvaluator2](../../../extensibility/debugger/reference/idebugexpressionevaluator2.md) |
| 16 | +Enables the expression evaluator (EE) to specify the callback interface that the debugger engine (DE) will use to read metric settings. |
| 17 | + |
| 18 | +## Syntax |
| 19 | + |
| 20 | +```cpp |
| 21 | +HRESULT SetCallback ( |
| 22 | + IDebugSettingsCallback2* pCallback |
| 23 | +); |
| 24 | +``` |
| 25 | + |
| 26 | +```csharp |
| 27 | +int SetCallback ( |
| 28 | + IDebugSettingsCallback2 pCallback |
| 29 | +); |
| 30 | +``` |
| 31 | + |
| 32 | +#### Parameters |
| 33 | +`pCallback` |
| 34 | +[in] Interface to use for the settings callback. |
| 35 | + |
| 36 | +## Return Value |
| 37 | +If successful, returns `S_OK`; otherwise, returns an error code. |
| 38 | + |
| 39 | +## Remarks |
| 40 | +This method provides an interface to the session debug manager that an expression evaluator can use to read metric settings. It is useful in remote debugging to read metrics on the [!INCLUDE[vsprvs](../../../code-quality/includes/vsprvs_md.md)] computer. |
| 41 | + |
| 42 | +## Example |
| 43 | +The following examples shows how to implement this method for a **CEE** object that exposes the [IDebugSettingsCallback2](../../../extensibility/debugger/reference/idebugsettingscallback2.md) interface. |
| 44 | + |
| 45 | +```cpp |
| 46 | +HRESULT CEE::SetCallback(IDebugSettingsCallback2* in_pCallback) |
| 47 | +{ |
| 48 | + // precondition |
| 49 | + INVARIANT( this ); |
| 50 | + |
| 51 | + // function body |
| 52 | + if (NULL != this->m_LanguageSpecificUseCases.pfSetCallback) |
| 53 | + { |
| 54 | + EEDomain::fSetCallback DomainVal = |
| 55 | + { |
| 56 | + in_pCallback |
| 57 | + }; |
| 58 | + |
| 59 | + BOOL bSuccess = (*this->m_LanguageSpecificUseCases.pfSetCallback)(DomainVal); |
| 60 | + ENSURE( bSuccess ); |
| 61 | + } |
| 62 | + |
| 63 | + // postcondition |
| 64 | + INVARIANT( this ); |
| 65 | + |
| 66 | + return S_OK; |
| 67 | +} |
| 68 | +``` |
| 69 | +
|
| 70 | +## See Also |
| 71 | +[IDebugExpressionEvaluator2](../../../extensibility/debugger/reference/idebugexpressionevaluator2.md) |
0 commit comments