共用方式為


IDebugEngine2::GetEngineID

取得偵錯引擎 (DE) 的 GUID。

HRESULT GetEngineID( 
   GUID* pguidEngine
);
int GetEngineID( 
   out Guid pguidEngine
);

參數

  • pguidEngine
    [] out傳回 DE 的 GUID。

傳回值

如果成功的話,會傳回S_OK。 否則,會傳回錯誤碼。

備註

典型的 Guid 的一些範例是guidScriptEng, guidNativeEng,或guidSQLEng。 新的偵錯引擎會建立自己的 GUID 來識別身分。

範例

下列範例會示範如何實作這個方法,如CEngine實作物件IDebugEngine2介面。

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;  
   }  
}  

請參閱

參考

IDebugEngine2