다음을 통해 공유


IPacket::WriteChar

업데이트: 2007년 11월

개체에 문자를 씁니다.

HRESULT WriteChar([in] wchar_t in_wcharValue)

매개 변수

  • in_wcharValue
    패킷에 쓸 문자입니다.

반환 값

메서드 호출의 결과를 나타내는 HRESULT 값입니다.

예제

이 예제에서 IDeviceAgentTransport::AcceptConnectionExIDevicePacketStream의 인스턴스를 만듭니다. 그런 후에 장치 패킷 스트림은 데스크톱의 RemoteAgent 개체에 데이터를 쓰는 데 사용됩니다. 전체 예제를 보려면 IDeviceAgentTransport를 참조하십시오.

// Let the desktop application know that this remote agent was deployed successfully 
// and that this remote agent will handle the supplied list of services.
LPCOLESTR szServiceIds[] = {L"F85E57BA-5AE9-4FF7-8433-6AB7D991D033"};
pTransport->AcknowledgeLaunch(1, szServiceIds);

// Open a communcation stream with desktop application on the service.
IDevicePacketStream *pStream = NULL;
pTransport->AcceptConnectionEx(szServiceIds[0], &pStream);

// Get an instance of IPacket
GetNewPacketFunc f2 = (GetNewPacketFunc) ::  GetProcAddress(hmod, L"GetNewPacket");
IPacket *pPacket = NULL;
f2(&pPacket);

// Write a message and sent the packet.
pPacket->WriteBool(true);
pPacket->WriteByte(0xff);
pPacket->WriteChar('c');
pPacket->WriteInt32(1024);
pPacket->WriteString(L"Hello Desktop Computer");
pStream->Write(pPacket);

관리되는 동등 항목

IPacket.WriteChar

요구 사항

DeviceAgentTransport.h

참고 항목

참조

IPacket