IDebugEngine2::CreatePendingBreakpoint
如需 Visual Studio 2017 的最新文件請參閱 Visual Studio 2017 文件。
偵錯引擎 (DE) 中建立暫止中斷點。
語法
HRESULT CreatePendingBreakpoint(
IDebugBreakpointRequest2* pBPRequest,
IDebugPendingBreakpoint2** ppPendingBP
);
int CreatePendingBreakpoint(
IDebugBreakpointRequest2 pBPRequest,
out IDebugPendingBreakpoint2 ppPendingBP
);
參數
pBPRequest
[in]IDebugBreakpointRequest2物件,描述要建立的暫止中斷點。
ppPendingBP
[out]傳回IDebugPendingBreakpoint2代表暫止中斷點的物件。
傳回值
如果成功,傳回S_OK
; 否則傳回錯誤碼。 通常會傳回E_FAIL
如果pBPRequest
參數不符合任何支援的語言,是否 DEpBPRequest
參數是無效或不完整。
備註
暫止中斷點是資訊的本質上的所有中斷點繫結至程式碼所需集合。 從這個方法傳回暫止中斷點未繫結至程式碼直到繫結方法呼叫。
針對每項暫止中斷點的使用者集合,工作階段偵錯管理員 (SDM) 呼叫這個方法中每個附加 DE。 而是留給 DE 確認中斷點是適用於該 DE 中執行的程式。
當使用者在程式碼的行上設定中斷點時,DE 是可用來將中斷點繫結至最接近的一行相當於這個程式碼的文件中。 這可讓使用者在多行陳述式的第一行設定中斷點,但將它繫結 (所有的程式碼所歸屬的偵錯資訊中) 的最後一行。
範例
下列範例示範如何實作這種簡單的方式CProgram
物件。 DE 實作IDebugEngine2::CreatePendingBreakpoint
無法再轉寄所有呼叫此實作中每個程式的方法。
HRESULT CProgram::CreatePendingBreakpoint(IDebugBreakpointRequest2* pBPRequest, IDebugPendingBreakpoint2** ppPendingBP)
{
// Create and initialize the CPendingBreakpoint object.
CComObject<CPendingBreakpoint> *pPending;
CComObject<CPendingBreakpoint>::CreateInstance(&pPending);
pPending->Initialize(pBPRequest, m_pInterp, m_pCallback, m_pEngine);
return pPending->QueryInterface(ppPendingBP);
}
另請參閱
IDebugEngine2
繫結
IDebugBreakpointRequest2
IDebugPendingBreakpoint2