共用方式為


IDebugPortSupplier2

這個介面會提供給工作階段的偵錯專案經理 (SDM) 的連接埠。

IDebugPortSupplier2 : IUnknown

實作器注意事項

自訂的連接埠提供者會實作這個介面代表連接埠提供者。

呼叫者的備忘稿

呼叫CoCreateInstance與連接埠提供者GUID會傳回這個介面 (這是一般的方式,來取得這個介面)。 例如:

IDebugPortSupplier2 *GetPortSupplier(GUID *pPortSupplierGuid)
{
    IDebugPortSupplier2 *pPS = NULL;
    if (pPortSupplierGuid != NULL) {
        CComPtr<IDebugPortSupplier2> spPortSupplier;
        spPortSupplier.CoCreateInstance(*pPortSupplierGuid);
        if (spPortSupplier != NULL) {
            pPS = spPortSupplier.Detach();
        }
    }
    return (pPS);
}

呼叫IDebugCoreServer2::GetPortSupplier會傳回這個介面,代表目前正在使用的連接埠提供者Visual Studio。

IDebugPort2::GetPortSupplier傳回這個介面,代表建立該連接埠的連接埠提供者。

IEnumDebugPortSuppliers2表示一份IDebugPortSupplier介面 ( IEnumDebugPortSuppliers介面取自IDebugCoreServer2::EnumPortSuppliers,代表所有連接埠供應商註冊的Visual Studio)。

偵錯引擎通常不常使用的連接埠提供者。

方法 Vtable 順序

下表顯示的方法IDebugPortSupplier2

方法

描述

IDebugPortSupplier2::GetPortSupplierName

取得連接埠的供應商名稱。

IDebugPortSupplier2::GetPortSupplierId

取得連接埠的供應商的識別項。

IDebugPortSupplier2::GetPort

從連接埠提供者取得連接埠。

IDebugPortSupplier2::EnumPorts

列舉已存在的連接埠。

IDebugPortSupplier2::CanAddPort

請確認連接埠提供者支援加入新的連接埠。

IDebugPortSupplier2::AddPort

新增連接埠。

IDebugPortSupplier2::RemovePort

移除連接埠。

備註

連接埠提供者可以辨別它自己的名字和 ID、 新增和移除連接埠,並列舉連接埠提供者所提供的所有連接埠。

需求

標頭: msdbg.h

Namespace: Microsoft.VisualStudio.Debugger.Interop

組件: Microsoft.VisualStudio.Debugger.Interop.dll

請參閱

參考

IDebugPort2::GetPortSupplier

IDebugCoreServer2::GetPortSupplier

IEnumDebugPortSuppliers2

概念

核心介面