IDeviceAgentTransport.AcknowledgeLaunch Method

Registers an array of service IDs. The device agent can accept connection requests from the development computer whose service ID is in the array.

Namespace:  Microsoft.SmartDevice.DeviceAgentTransport
Assembly:  Microsoft.SmartDevice.DeviceAgentTransport (in Microsoft.SmartDevice.DeviceAgentTransport.dll)

Syntax

'Declaration
Sub AcknowledgeLaunch ( _
    in_ArraySize As UInteger, _
    in_szServiceIds As String() _
)
'Usage
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[]
)

Parameters

  • in_szServiceIds
    Type: array<System.String[]

    Service IDs on which the agent accepts connections.

Exceptions

Exception Condition
COMException

HRESULT information:

  • E_INVALIDARG | Invalid arguments

  • E_FAIL | Return value for any other failure

ArgumentNullException

If the in_szServiceIds is specified as NULL.

Remarks

Service IDs are used by the device agent to identify which connection requests the device agent can accept. The device agent can only accept connections whose service IDs have been registered by using this method.

Service IDs cannot contain spaces or be one of the reserved service IDs such as "", "Host", "Transport", "Shutdown", or "Accept". To ensure the uniqueness, machine-generated GUIDs are often used as service IDs. To generate a GUID, select Create GUID in the Tools menu.

Examples

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);

.NET Framework Security

See Also

Reference

IDeviceAgentTransport Interface

IDeviceAgentTransport Members

Microsoft.SmartDevice.DeviceAgentTransport Namespace