CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2002
    Location
    St.Louis, MO
    Posts
    27

    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?
    Thanks
    Tom Wright

  2. #2
    Join Date
    Oct 2000
    Location
    China
    Posts
    23
    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());

  3. #3
    Join Date
    Sep 2002
    Location
    St.Louis, MO
    Posts
    27
    Thanks for the help but c_str is not a member of the CString class.
    Thanks
    Tom Wright

  4. #4
    Join Date
    Oct 2000
    Location
    China
    Posts
    23
    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());

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured