更新:2007 年 11 月
定義關閉回呼物件必須實作的方法。
命名空間: Microsoft.SmartDevice.DeviceAgentTransport
組件: Microsoft.SmartDevice.DeviceAgentTransport (在 Microsoft.SmartDevice.DeviceAgentTransport.dll 中)
語法
<InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)> _
<GuidAttribute("1ECA6EBC-4B7A-4BA6-8516-DB38DF0045A5")> _
Public Interface IAgentTransportShutdownCallback
Dim instance As IAgentTransportShutdownCallback
[InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
[GuidAttribute("1ECA6EBC-4B7A-4BA6-8516-DB38DF0045A5")]
public interface IAgentTransportShutdownCallback
[InterfaceTypeAttribute(ComInterfaceType::InterfaceIsIUnknown)]
[GuidAttribute(L"1ECA6EBC-4B7A-4BA6-8516-DB38DF0045A5")]
public interface class IAgentTransportShutdownCallback
public interface IAgentTransportShutdownCallback
備註
只要裝置上正在執行 conmanclient2.exe,裝置代理程式就相當實用。關閉 conmanclient2.exe 時,所有裝置代理程式也會關閉。裝置代理程式可以要求接收關閉通知,以順利執行清除並離開。為了接收關閉通知,裝置代理程式必須定義實作此介面的類別 (Class),然後再使用 IDeviceAgentTransport.RegisterShutdownCallback 將其註冊。
範例
' Define your own shutdown implementation
Class ShutdownCallback
Implements IAgentTransportShutdownCallback
Sub Shutdown(ByVal in_pUnknown As Object) _
Implements IAgentTransportShutdownCallback.Shutdown
' Insert cleanup code here
End Sub 'Shutdown
End Class 'ShutdownCallback
// Define your own shutdown implementation
class ShutdownCallback : IAgentTransportShutdownCallback
{
public void Shutdown(object in_pUnknown)
{
// Insert cleanup code here
}
}