Hi,

Iam using CAsyncSocket for let clients connect to my App.

Now I tried to send Data to the client.

After connecting from client is established i receive the READYTOSEND.



First I send the content of a textarea when clicked on a button like
this:

((CFCSDlg*)m_pWnd)->GetConnectSocket()->Send((LPCTSTR)
m_sCommand,m_sCommand.GetLength()+1);

Everything works well, even more than 1 time clicking the send button

Then I tried to send thru the socket on a function which is called
after receiving data.


iSent = Send((LPCTSTR)Data, Len+1); // Absenden der Daten
if (iSent==SOCKET_ERROR)
{AfxMessageBox("Server send error");

The result:

Unhandled exception at 0x004059c5 in FCS.exe: 0xC0000005: Access
violation reading location 0x000002dc.


What is the difference between Sending after click and by a function
after receiving?

Thanks in advance