-
NetMessageBufferSend
I'm having trouble with the LPBYTE param of this API.
I want to move text from my dialog based application to this api to send.
CString buffer;
m_cSendText.GetWindowText(buffer);
nasStatus = NetMessageBufferSend(NULL,
awcToNameW,
awcFromNameW,
(LPBYTE)&buffer,
m_cSendText.GetLength());
But I'm getting junk in the message box. Any suggestions?
-
Hi:
CString buffer;
m_cSendText.GetWindowText(buffer);
nasStatus = NetMessageBufferSend(NULL,
awcToNameW,
awcFromNameW,
(LPBYTE)&buffer, ,
m_cSendText.GetLength());
maybe
nasStatus = NetMessageBufferSend(NULL,
awcToNameW,
awcFromNameW,
(LPBYTE)buffer.c_str(), ,
m_cSendText.GetLength());
-
Thanks for the help but c_str is not a member of the CString class.
-
Hi:
sorry , I 'm not familiar with CString .
I look up the MSDN .found the function CString::GetString()
is do the same work as the std::string::c_str(); so you should use
nasStatus = NetMessageBufferSend(NULL,
awcToNameW,
awcFromNameW,
(LPBYTE)buffer.GetString(),
m_cSendText.GetLength());