Click here to Skip to main content
15,899,314 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionThis 'works' but would you ever want to ?? Pin
RedZenBird3-Oct-02 12:21
RedZenBird3-Oct-02 12:21 
AnswerRe: This 'works' but would you ever want to ?? Pin
RedZenBird3-Oct-02 12:49
RedZenBird3-Oct-02 12:49 
AnswerRe: This 'works' but would you ever want to ?? Pin
Jörgen Sigvardsson3-Oct-02 13:47
Jörgen Sigvardsson3-Oct-02 13:47 
GeneralRe: This 'works' but would you ever want to ?? Pin
RedZenBird3-Oct-02 14:46
RedZenBird3-Oct-02 14:46 
GeneralRe: This 'works' but would you ever want to ?? Pin
Jörgen Sigvardsson3-Oct-02 15:06
Jörgen Sigvardsson3-Oct-02 15:06 
GeneralRe: This 'works' but would you ever want to ?? Pin
RedZenBird3-Oct-02 15:16
RedZenBird3-Oct-02 15:16 
GeneralCAsyncSoccket Pin
moloko3-Oct-02 11:59
moloko3-Oct-02 11:59 
GeneralRe: CAsyncSoccket Pin
Alexthombra3-Oct-02 19:21
Alexthombra3-Oct-02 19:21 
Fist override the Onreceive event of ur CMySock class
like as follows


void CClientSocket::OnReceive(int nErrorCode)
{
// TODO: Add your specialized code here and/or call the base class
AfxGetMainWnd()->PostMessage(WM_APP + 24, 0,0);
CSocket::OnReceive(nErrorCode);
}

Then post a MEssage to the main window from here "AfxGetMainWnd()->PostMessage(WM_APP + 24, 0,0);"

I then dialog catch this message

ON_MESSAGE(SOCK_RCV_MSG, OnReceive)

void CClientDlg::OnReceive()
{
char buff[SEND_BUF_SIZE];
int nBytes;
CString strLog;



nBytes = m_Sock1->Receive(buff, SEND_BUF_SIZE);
if(nBytes == 0)
{
// got disconnected
}


}

Now u can do anything witht he data in the buff

Hope this will help u
GeneralRe: CAsyncSoccket Pin
moloko4-Oct-02 14:25
moloko4-Oct-02 14:25 
GeneralUndocumented Windows APIs Pin
uniken3-Oct-02 11:59
uniken3-Oct-02 11:59 
GeneralRe: Undocumented Windows APIs Pin
Andreas Saurwein4-Oct-02 0:33
Andreas Saurwein4-Oct-02 0:33 
GeneralCListCtrl OnColumnClick Pin
ns3-Oct-02 10:44
ns3-Oct-02 10:44 
GeneralRe: CListCtrl OnColumnClick Pin
Tomasz Sowinski3-Oct-02 10:52
Tomasz Sowinski3-Oct-02 10:52 
GeneralRe: CListCtrl OnColumnClick Pin
ns3-Oct-02 10:58
ns3-Oct-02 10:58 
GeneralRe: CListCtrl OnColumnClick Pin
Tomasz Sowinski3-Oct-02 11:02
Tomasz Sowinski3-Oct-02 11:02 
GeneralRe: CListCtrl OnColumnClick Pin
ns3-Oct-02 11:02
ns3-Oct-02 11:02 
GeneralRe: CListCtrl OnColumnClick Pin
Tomasz Sowinski3-Oct-02 11:04
Tomasz Sowinski3-Oct-02 11:04 
GeneralRe: CListCtrl OnColumnClick Pin
ns3-Oct-02 11:09
ns3-Oct-02 11:09 
GeneralRe: CListCtrl OnColumnClick Pin
Tomasz Sowinski3-Oct-02 11:15
Tomasz Sowinski3-Oct-02 11:15 
Generalyay!!! Pin
ns3-Oct-02 11:29
ns3-Oct-02 11:29 
Generalitemclick Pin
ns3-Oct-02 11:31
ns3-Oct-02 11:31 
GeneralRe: itemclick Pin
Tomasz Sowinski3-Oct-02 11:32
Tomasz Sowinski3-Oct-02 11:32 
GeneralRe: itemclick Pin
ns3-Oct-02 11:39
ns3-Oct-02 11:39 
GeneralFTP Server :: Winsock Pin
valikac3-Oct-02 10:37
valikac3-Oct-02 10:37 
GeneralRe: FTP Server :: Winsock Pin
Aaron Schaefer3-Oct-02 11:28
Aaron Schaefer3-Oct-02 11:28 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.