本文整理汇总了C++中CBuffer::Buffer方法的典型用法代码示例。如果您正苦于以下问题:C++ CBuffer::Buffer方法的具体用法?C++ CBuffer::Buffer怎么用?C++ CBuffer::Buffer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CBuffer
的用法示例。
在下文中一共展示了CBuffer::Buffer方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: sizeof
inline const void* CNetDDEPacket::DataBuffer() const
{
ASSERT(m_oBuffer.Buffer() != NULL);
const byte* pBuffer = static_cast<const byte*>(m_oBuffer.Buffer());
return pBuffer + sizeof(Header);
}
示例2: CNetDDEPacket
inline CNetDDEPacket::CNetDDEPacket(uint nDataType, const CBuffer& oBuffer)
{
uint nPacketID = ASYNC_PACKET_ID;
if ((nDataType & PACKET_SYNC_MASK) == SYNC_PACKET)
nPacketID = GeneratePktID();
Create(nDataType, nPacketID, oBuffer.Buffer(), oBuffer.Size());
}
示例3: OnDDEPoke
void CNetDDESvrApp::OnDDEPoke(CNetDDESvrSocket& oConnection, CNetDDEPacket& oReqPacket)
{
ASSERT(oReqPacket.DataType() == CNetDDEPacket::DDE_POKE);
bool bResult = false;
HCONV hConv;
uint32 nConvID;
CString strItem;
uint32 nFormat;
CBuffer oData;
// Decode message.
CMemStream oStream(oReqPacket.Buffer());
oStream.Open();
oStream.Seek(sizeof(CNetDDEPacket::Header));
oStream.Read(&hConv, sizeof(hConv));
oStream >> nConvID;
oStream >> strItem;
oStream >> nFormat;
oStream >> oData;
oStream.Close();
if (App.m_bTraceRequests)
{
CString strData;
if (nFormat == CF_TEXT)
strData = oData.ToString(ANSI_TEXT);
else if (nFormat == CF_UNICODETEXT)
strData = oData.ToString(UNICODE_TEXT);
else
strData = CClipboard::FormatName(nFormat);
App.Trace(TXT("DDE_POKE: %s %s [%s]"), strItem, CClipboard::FormatName(nFormat), strData);
}
try
{
// Locate the conversation.
CDDECltConv* pConv = m_pDDEClient->FindConversation(hConv);
if (pConv != NULL)
{
// Call DDE to do the poke.
pConv->Poke(strItem, nFormat, oData.Buffer(), oData.Size());
bResult = true;
}
}
catch (CDDEException& e)
{
App.Trace(TXT("DDE_ERROR: %s"), e.twhat());
}
// Create response message.
CBuffer oRspBuffer;
CMemStream oRspStream(oRspBuffer);
oRspStream.Create();
oRspStream << bResult;
oRspStream.Close();
// Send response message.
CNetDDEPacket oRspPacket(CNetDDEPacket::DDE_POKE, oReqPacket.PacketID(), oRspBuffer);
oConnection.SendPacket(oRspPacket);
// Update stats.
++m_nPktsSent;
}
示例4:
inline CNetDDEPacket::Header* CNetDDEPacket::GetHeader()
{
ASSERT(m_oBuffer.Buffer() != NULL);
return static_cast<Header*>(m_oBuffer.Buffer());
}