Skip to content

Commit d1caf8c

Browse files
authored
Merge pull request #2480 from changeworld/patch-13
Delete unnecessary spaces
2 parents 69e10b2 + 5bf47c2 commit d1caf8c

File tree

1 file changed

+58
-58
lines changed

1 file changed

+58
-58
lines changed

docs/extensibility/debugger/event-sources-visual-studio-sdk.md

Lines changed: 58 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -2,69 +2,69 @@
22
title: "Event Sources (Visual Studio SDK) | Microsoft Docs"
33
ms.date: "11/04/2016"
44
ms.topic: "conceptual"
5-
helpviewer_keywords:
5+
helpviewer_keywords:
66
- "debugging [Debugging SDK], event sources"
77
ms.assetid: b9ba0908-ae4c-4a64-aab1-bee453dd7a22
88
author: "gregvanl"
99
ms.author: "gregvanl"
1010
manager: jillfra
11-
ms.workload:
11+
ms.workload:
1212
- "vssdk"
1313
---
1414
# Event sources (Visual Studio SDK)
15-
There are two sources of events: the debug engine (DE) and the Session Debug Manager (SDM). Events sent from a DE have a non-NULL engine, while events sent from the SDM have a NULL engine.
16-
17-
## Example
18-
The following example shows how to send the **IDebugProgramCreateEvent2** from the DE to the SDM.
19-
20-
```csharp
21-
CDebugProgramCreateEvent* pProgramCreateEvent = new CDebugProgramCreateEvent();
22-
if (FAILED(pCallback->Event(m_pEngine, NULL, m_pProgram, NULL, pProgramCreateEvent, IID_IDebugProgramCreateEvent2, EVENT_ASYNCHRONOUS)))
23-
{
24-
// Handle failure here.
25-
}
26-
]
27-
28-
CEvent * pProgCreate = new CEvent(IID_IDebugProgramCreateEvent2, EVENT_ASYNCHRONOUS);
29-
pProgCreate->SendEvent(pCallback, m_pEngine, (IDebugProgram2 *)this, NULL);
30-
31-
HRESULT CEvent::SendEvent(IDebugEventCallback2 *pCallback, IDebugEngine2 *pEngine, IDebugProgram2 *pProgram, IDebugThread2 *pThread) {
32-
HRESULT hr;
33-
34-
if (m_dwAttrib & EVENT_STOPPING)
35-
{
36-
hr = SendStoppingEvent(pCallback, pEngine, pProgram, pThread);
37-
}
38-
else if (m_dwAttrib & EVENT_SYNCHRONOUS)
39-
{
40-
hr = SendSynchronousEvent(pCallback, pEngine, pProgram, pThread);
41-
}
42-
else
43-
{
44-
assert(m_dwAttrib == 0);
45-
hr = SendAsynchronousEvent(pCallback, pEngine, pProgram, pThread);
46-
}
47-
48-
return hr;
49-
}
50-
51-
HRESULT CEvent::SendAsynchronousEvent(IDebugEventCallback2 *pCallback, IDebugEngine2 *pEngine, IDebugProgram2 *pProgram, IDebugThread2 *pThread) {
52-
53-
HRESULT hr;
54-
55-
// Make sure the CEvent object running this code is not deleted until the code completes.
56-
AddRef();
57-
58-
pCallback->Event(pEngine, NULL, pProgram, pThread, (IDebugEvent2 *)this, m_riid, m_dwAttrib);
59-
60-
// No error recovery here.
61-
hr = S_OK;
62-
63-
Release();
64-
return hr;
65-
}
66-
67-
```
68-
69-
## See also
70-
[Sending events](../../extensibility/debugger/sending-events.md)
15+
There are two sources of events: the debug engine (DE) and the Session Debug Manager (SDM). Events sent from a DE have a non-NULL engine, while events sent from the SDM have a NULL engine.
16+
17+
## Example
18+
The following example shows how to send the **IDebugProgramCreateEvent2** from the DE to the SDM.
19+
20+
```csharp
21+
CDebugProgramCreateEvent* pProgramCreateEvent = new CDebugProgramCreateEvent();
22+
if (FAILED(pCallback->Event(m_pEngine, NULL, m_pProgram, NULL, pProgramCreateEvent, IID_IDebugProgramCreateEvent2, EVENT_ASYNCHRONOUS)))
23+
{
24+
// Handle failure here.
25+
}
26+
]
27+
28+
CEvent * pProgCreate = new CEvent(IID_IDebugProgramCreateEvent2, EVENT_ASYNCHRONOUS);
29+
pProgCreate->SendEvent(pCallback, m_pEngine, (IDebugProgram2 *)this, NULL);
30+
31+
HRESULT CEvent::SendEvent(IDebugEventCallback2 *pCallback, IDebugEngine2 *pEngine, IDebugProgram2 *pProgram, IDebugThread2 *pThread) {
32+
HRESULT hr;
33+
34+
if (m_dwAttrib & EVENT_STOPPING)
35+
{
36+
hr = SendStoppingEvent(pCallback, pEngine, pProgram, pThread);
37+
}
38+
else if (m_dwAttrib & EVENT_SYNCHRONOUS)
39+
{
40+
hr = SendSynchronousEvent(pCallback, pEngine, pProgram, pThread);
41+
}
42+
else
43+
{
44+
assert(m_dwAttrib == 0);
45+
hr = SendAsynchronousEvent(pCallback, pEngine, pProgram, pThread);
46+
}
47+
48+
return hr;
49+
}
50+
51+
HRESULT CEvent::SendAsynchronousEvent(IDebugEventCallback2 *pCallback, IDebugEngine2 *pEngine, IDebugProgram2 *pProgram, IDebugThread2 *pThread) {
52+
53+
HRESULT hr;
54+
55+
// Make sure the CEvent object running this code is not deleted until the code completes.
56+
AddRef();
57+
58+
pCallback->Event(pEngine, NULL, pProgram, pThread, (IDebugEvent2 *)this, m_riid, m_dwAttrib);
59+
60+
// No error recovery here.
61+
hr = S_OK;
62+
63+
Release();
64+
return hr;
65+
}
66+
67+
```
68+
69+
## See also
70+
[Sending events](../../extensibility/debugger/sending-events.md)

0 commit comments

Comments
 (0)