Share via


IDebugBeforeSymbolSearchEvent2::GetModuleName

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 the name of the module currently being debugged.

Syntax

HRESULT GetModuleName(   
   BSTR *pbstrModuleName  
);  
public int GetModuleName (  
   string pbstrModuleName  
);  

Parameters

pbstrModuleName
[out] Name of the module.

Return Value

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

Example

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

STDMETHODIMP CDebugBeforeSymbolSearchEventBase::GetModuleName(BSTR *pbstrModuleName)  
{  
    HRESULT hRes = E_FAIL;  
  
    if (m_bstrModuleName)  
    {  
  
        *pbstrModuleName = SysAllocString( m_bstrModuleName);  
  
        if (*pbstrModuleName)  
        {  
            hRes = S_OK;  
        }  
    }  
  
    return ( hRes );  
}  

See Also

IDebugBeforeSymbolSearchEvent2