Server - Socket to receive XML messages, dialog problem

Noah Aas 985 Reputation points
2025-04-24T16:17:55.42+00:00

Hello,

I get into the receiving routine.

But pThis is NULL
and
UpdateReceiveEdit
causes an exception.
What can the solution look like and what is the cause?

ServerSocket_cpp.TXT

ServerSocket_h.TXT

WrapperSocketDlg_cpp.TXT

WrapperSocketDlg_h.TXT

https://1drv.ms/u/s!AkxC5fEcJdT1dWvN3AH-eMusXho?e=Z9Osyc


void CWSocketDlg::ReceiveCallback(char* buffer, int length)
{
	CWSocketDlg* pThis = (CWSocketDlg*)AfxGetMainWnd();
	pThis->UpdateReceiveEdit(buffer, length);
	CString str(buffer, length);
	pThis->m_receiveEdit.SetWindowText(str);
}
void CWSocketDlg::UpdateReceiveEdit(char* buffer, int length)
{
	//CString str(buffer, length);
	//m_receiveEdit.SetWindowText(str);
	//UpdateData(false);	
}
C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,912 questions
0 comments No comments
{count} votes