Share via


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 중 하나일 수 없습니다. 서비스 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 네임스페이스