IDebugEngine2::GetEngineID
取得偵錯引擎的 GUID(DE)。
語法
參數
pguidEngine
[out]傳回 DE 的 GUID。
傳回值
如果成功,則會傳回 S_OK
;否則,會傳回錯誤碼。
備註
一般 GUID 的一些範例包括 guidScriptEng
、 guidNativeEng
或 guidSQLEng
。 新的偵錯引擎會建立自己的 GUID 以進行識別。
範例
下列範例示範如何針對實作 IDebugEngine2 介面的簡單CEngine
物件實作這個方法。
HRESULT CEngine::GetEngineId(GUID *pguidEngine) {
if (pguidEngine) {
// Set pguidEngine to guidBatEng, as defined in the Batdbg.idl file.
// Other languages would require their own guidDifferentEngine to be
//defined in the Batdbg.idl file.
*pguidEngine = guidBatEng;
return NOERROR; // This is typically S_OK.
} else {
return E_INVALIDARG;
}
}