IDeviceAgentTransport.AcknowledgeLaunch メソッド

更新 : 2007 年 11 月

サービス ID の配列を登録します。デバイス エージェントは、この配列に含まれるサービス ID を持つ開発用コンピュータからの接続要求を受け入れることができます。

名前空間 :  Microsoft.SmartDevice.DeviceAgentTransport
アセンブリ :  Microsoft.SmartDevice.DeviceAgentTransport (Microsoft.SmartDevice.DeviceAgentTransport.dll 内)

構文

'宣言
Sub AcknowledgeLaunch ( _
    in_ArraySize As UInteger, _
    in_szServiceIds As String() _
)
'使用
Dim instance As IDeviceAgentTransport
Dim in_ArraySize As UInteger
Dim in_szServiceIds As String()

instance.AcknowledgeLaunch(in_ArraySize, _
    in_szServiceIds)
void AcknowledgeLaunch(
    uint in_ArraySize,
    string[] in_szServiceIds
)
void AcknowledgeLaunch(
    [InAttribute] unsigned int in_ArraySize, 
    [InAttribute] array<String^>^ in_szServiceIds
)
function AcknowledgeLaunch(
    in_ArraySize : uint, 
    in_szServiceIds : String[]
)

パラメータ

  • in_ArraySize
    型 : System.UInt32

    サービス ID 配列のサイズ。

  • in_szServiceIds
    型 : array<System.String[]

    エージェントが接続を受け入れるサービス ID。

例外

例外 条件
COMException

HRESULT 情報を提供します。

  • E_INVALIDARG - 無効な引数

  • E_FAIL - その他のエラーを示す戻り値

ArgumentNullException

in_szServiceIds が NULL として指定されている場合。

解説

サービス ID は、受け入れることができる接続要求を識別するために、デバイス エージェントによって使用されます。デバイス エージェントは、このメソッドを使用して登録されたサービス ID を持つ接続のみを受け入れることができます。

サービス ID に空白を使用したり、""、"Host"、"Transport"、"Shutdown"、"Accept" などの予約されたサービス ID を指定したりすることはできません。一意性を保証するために、多くの場合、コンピュータによって生成された GUID がサービス ID として使用されます。GUID を生成するには、[ツール] メニューの [GUID の作成] をクリックします。

Dim serviceids(0 To 0) As String
serviceids(0) = "2FAD740C-B5D3-4ad0-BE23-5682503584BF"

' Get an instance of Device Agent Transport
Dim transport As IDeviceAgentTransport = _
    DeviceAgentTransportFactory.GetAgentTransport()
' Register the callback object with the Device Agent Transport.
Dim shutdownCallback As New ShutdownCallback()
transport.RegisterShutdownCallback(shutdownCallback, shutdownCallback)
' Let the desktop application know that this device agent was deployed successfully 
' and will handle the supplied list of service IDs.
transport.AcknowledgeLaunch(Convert.ToUInt32(serviceids.Length), serviceids)

' Open a communcation stream with desktop application on the service.
Dim packetStream As IDevicePacketStream
transport.AcceptConnectionEx(serviceids(0), packetStream)
string[] serviceids = { "2FAD740C-B5D3-4ad0-BE23-5682503584BF" };

// Get an instance of Device Agent Transport
IDeviceAgentTransport transport = DeviceAgentTransportFactory.GetAgentTransport();

// Register the callback object with the Device Agent Transport.
ShutdownCallback shutdownCallback = new ShutdownCallback();
transport.RegisterShutdownCallback(shutdownCallback, shutdownCallback);

// Let the desktop application know that this device agent was deployed successfully 
// and will handle the supplied list of service IDs.
transport.AcknowledgeLaunch(Convert.ToUInt32(serviceids.Length), serviceids);

// Open a communcation stream with desktop application on the service.
IDevicePacketStream packetStream;
transport.AcceptConnectionEx(serviceids[0], out packetStream);

アクセス許可

  • 直前の呼び出し元に対する完全な信頼。このメンバは、部分的に信頼されているコードから使用することはできません。詳細については、「部分信頼コードからのライブラリの使用」を参照してください。

参照

参照

IDeviceAgentTransport インターフェイス

IDeviceAgentTransport メンバ

Microsoft.SmartDevice.DeviceAgentTransport 名前空間