Share via


IDebugCodeContext3::GetModule

Note

This article applies to Visual Studio 2015. If you're looking for the latest Visual Studio documentation, see Visual Studio documentation. We recommend upgrading to the latest version of Visual Studio. Download it here

Retrieves a reference to the interface of the debug module.

Syntax

HRESULT GetModule(   
   IDebugModule2 **ppModule  
);  
public int GetModule(   
   out IDebugModule2 ppModule  
);  

Parameters

ppModule
[out] Reference to the debug module interface.

Return Value

If successful, returns S_OK; otherwise, returns an error code.

Example

The following example shows how to implement this method for a CDebugCodeContext object that exposes the IDebugBeforeSymbolSearchEvent2 interface.

HRESULT CDebugCodeContext::GetModule(IDebugModule2** ppModule)  
{  
    HRESULT hr = S_OK;  
    CComPtr<CModule> pModule;  
  
    IfFalseGo( ppModule, E_INVALIDARG );  
    *ppModule = NULL;  
  
    IfFailGo( this->GetModule(&pModule) );  
    IfFailGo( pModule->QueryInterface(IID_IDebugModule2, (void**) ppModule) );  
  
Error:  
  
    return hr;  
}  

See Also

IDebugCodeContext3