Compartilhar via


IPacket::WriteByte

Grava um byte para o objeto.

HRESULT WriteByte([in] BYTE in_byteValue)

Parâmetros

  • in_byteValue
    Byte a ser gravado no pacote.

Valor de retorno

An HRESULT valor que indica o resultado da telefonar do método.

Exemplo

Neste exemplo, IDeviceAgentTransport::AcceptConnectionEx cria uma instância de IDevicePacketStream. O fluxo de pacote do dispositivo é usado para gravar dados para o RemoteAgent objeto da área de trabalho. For the complete example, see 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);

Equivalente gerenciado

IPacket.WriteByte

Requisitos

DeviceAgentTransport.h

Consulte também

Referência

IPacket