IDebugProgramPublisher2

此接口允许调试引擎 (DE)或自定义端口提供程序进行调试的注册过程。

IDebugProgramPublisher2 : IUnknown

实现者说明

Visual Studio 实现此接口来正在调试的注册过程为了使其可认为调试在多个进程之间。

调用方的说明

调用 COM 的与 CLSID_ProgramPublisher 的 CoCreateInstance 函数获取此接口 (请参见示例)。 DE 或自定义端口提供程序使用此接口来注册表示正在调试的程序的程序节点。

方法按 Vtable 顺序

此接口执行以下方法:

方法

说明

IDebugProgramPublisher2:: PublishProgramNode

有一个程序节点可用 DES 和会议调试管理器 (SDM)。

IDebugProgramPublisher2:: UnpublishProgramNode

删除程序 " 节点,以使其不再可用。

IDebugProgramPublisher2:: PublishProgram

有一个程序提供 DES 和 SDM。

IDebugProgramPublisher2:: UnpublishProgram

移除程序,以便它不再可用。

IDebugProgramPublisher2:: SetDebuggerPresent

设置指示的标志调试器存在。

备注

此接口使程序,并提供程序节点 (即 “发布”它们) 供 DES 和会议使用调试管理器 (SDM)。 访问发布程序和程序节点,使用 IDebugProgramProvider2 接口。 这是 Visual Studio 可以考虑的唯一程序进行调试。

要求

标题:msdbg.h

命名空间:Microsoft.VisualStudio.Debugger.Interop

程序集:Microsoft.VisualStudio.Debugger.Interop.dll

示例

此示例演示如何实例化程序发行者和注册程序节点。 这将从本教程中, Publishing the Program Node中采用。

// This is how m_srpProgramPublisher is defined in the class definition:
// CComPtr<IDebugProgramPublisher2> m_srpProgramPublisher.

void CProgram::Start(IDebugEngine2 * pEngine)
{
    m_spEngine = pEngine;

    HRESULT hr = m_srpProgramPublisher.CoCreateInstance(CLSID_ProgramPublisher);
    if ( FAILED(hr) )
    {
        ATLTRACE("Failed to create the program publisher: 0x%x.", hr);
        return;
    }

    // Register ourselves with the program publisher. Note that
    // CProgram implements the IDebgProgramNode2 interface, hence
    // the static cast on "this".
    hr = m_srpProgramPublisher->PublishProgramNode(
        static_cast<IDebugProgramNode2*>(this));
    if ( FAILED(hr) )
    {
        ATLTRACE("Failed to publish the program node: 0x%x.", hr);
        m_srpProgramPublisher.Release();
        return;
    }

    ATLTRACE("Added program node.\n");
}

请参见

参考

IDebugProgramProvider2

概念

核心接口