Please see my comment to the question. It's quite appear that you don't understand what classes are and why do you use them. I can answer, but I don't think it can help you unless you step back and learn at least a bit about classes and their instances, and also about "static".
CsocketDlg myDlg = myDlg.m_strMessage =
CsocketDlg * myDlgPointer = myDlgPointer -> m_strMessage =
But you also need enough access to this member. Alternatively, you could have
static
field, which could be accessed via the class — not recommended! It's too early to explain why; first, you need to learn about classes. At this moment, you have no clue. Don't worry, you will learn it soon. Just do it.
—SA