IDeviceAgentTransport.AcknowledgeLaunch, méthode

Mise à jour : novembre 2007

Enregistre un tableau d'ID de service. L'agent Smart Device peut accepter des demandes de connexion de l'ordinateur de développement dont l'ID de service figure dans le tableau.

Espace de noms :  Microsoft.SmartDevice.DeviceAgentTransport
Assembly :  Microsoft.SmartDevice.DeviceAgentTransport (dans Microsoft.SmartDevice.DeviceAgentTransport.dll)

Syntaxe

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[]
)

Paramètres

  • in_ArraySize
    Type : System.UInt32

    Taille du tableau des ID de service.

  • in_szServiceIds
    Type : array<System.String[]

    ID de service sur lesquels l'agent accepte les connexions.

Exceptions

Exception Condition
COMException

Informations HRESULT :

  • E_INVALIDARG | arguments non valides

  • E_FAIL | valeur de retour pour tout autre échec

ArgumentNullException

Si in_szServiceIds est spécifié comme NULL.

Notes

Les ID de service sont utilisés par l'agent Smart Device pour identifier les demandes de connexion qu'il peut accepter. L'agent Smart Device peut accepter uniquement des connexions dont les ID de service ont été enregistrés par le biais de cette méthode.

Les ID de service ne peuvent pas contenir d'espaces ou être l'un des ID de service réservés tels que "", "Host", "Transport", "Shutdown" ou "Accept". Pour garantir le caractère unique, les GUID générés par ordinateur sont souvent utilisés comme ID de service. Pour générer un GUID, sélectionnez Create GUID dans le menu Outils.

Exemples

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

Autorisations

Voir aussi

Référence

IDeviceAgentTransport, interface

Membres IDeviceAgentTransport

Microsoft.SmartDevice.DeviceAgentTransport, espace de noms