Click here to Skip to main content
15,900,482 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: DB_NUMERIC Pin
Nick Blumhardt3-May-01 16:49
Nick Blumhardt3-May-01 16:49 
GeneralMulti-threaded exception Pin
3-May-01 13:16
suss3-May-01 13:16 
GeneralRe: Multi-threaded exception Pin
4-May-01 4:48
suss4-May-01 4:48 
QuestionMessages? Pin
XKent3-May-01 11:55
XKent3-May-01 11:55 
AnswerRe: Messages? Pin
3-May-01 17:47
suss3-May-01 17:47 
GeneralToolbar Button Invisible Pin
3-May-01 8:44
suss3-May-01 8:44 
GeneralSending windows messages for socket activity Pin
3-May-01 7:40
suss3-May-01 7:40 
GeneralRe: You need the good book about Socket Pin
Masaaki Onishi3-May-01 17:49
Masaaki Onishi3-May-01 17:49 
Hello, the codegurus around the world.;)

You need the good book about Socket programming. But, the book about Socket sometimes
use the basic of WinSock, not CSocket or CAsyncSocket class.

I got this code from some Wrox book about MFC, but I forgot this titile.Cry | :((

Define the following the message map entry at CYourAsyncSocket class.
#ifndef WM_SOCKETEVENT
#error You must define 'WM_SOCKETEVENT' as a WM_USER message.
#endif

#ifndef ON_WM_SOCKETEVENT
#define ON_WM_SOCKETEVENT() \
	{ WM_SOCKETEVENT, 0, 0, 0, AfxSig_vwwh, \
		(AFX_PMSG)(AFX_PMSGW)(void (AFX_MSG_CALL CWnd::*)(UINT, UINT, SOCKET))OnSocketEvent },
#endif


Now, we can use this message function at some Dialog;
// some Dialog header file
afx_msg void OnSocketEvent(UINT nEvent, UINT nErroCode, SOCKET hSocket);


BEGIN_MESSAGE_MAP(CWinFingerDlg, CDialog)
	//{{AFX_MSG_MAP(CWinFingerDlg)
       ................
	//}}AFX_MSG_MAP
	ON_WM_SOCKETEVENT ()
END_MESSAGE_MAP()

...................
   CMyDialog::OnSockeEvent (UINT nEvnet, UINT nErroCode, SOCKET hSocket)
   {
      //The code to get Socket error or result...
   }



Have a nice day!
-Masaaki Onishi-
Generalbuttons have icon and caption (as "START") Pin
3-May-01 7:12
suss3-May-01 7:12 
GeneralRe: buttons have icon and caption (as Pin
Davide Calabro3-May-01 7:36
Davide Calabro3-May-01 7:36 
GeneralRe: buttons have icon and caption (as Pin
3-May-01 8:13
suss3-May-01 8:13 
GeneralRe: buttons have icon and caption (as Pin
Davide Calabro3-May-01 20:51
Davide Calabro3-May-01 20:51 
GeneralBitmap question Pin
3-May-01 6:52
suss3-May-01 6:52 
GeneralRe: Bitmap question Pin
Christian Graus3-May-01 13:20
protectorChristian Graus3-May-01 13:20 
GeneralRe: Bitmap question Pin
4-May-01 0:46
suss4-May-01 0:46 
GeneralHELP !!! comunication between dialogs! Pin
3-May-01 6:04
suss3-May-01 6:04 
GeneralRe: HELP !!! comunication between dialogs! Pin
Christian Graus3-May-01 13:24
protectorChristian Graus3-May-01 13:24 
GeneralRe: HELP !!! comunication between dialogs! Pin
Masaaki Onishi3-May-01 17:17
Masaaki Onishi3-May-01 17:17 
Generalsimple for statement can't work! Pin
hearties3-May-01 5:42
hearties3-May-01 5:42 
GeneralRe: simple for statement can't work! Pin
David Fedolfi3-May-01 5:46
David Fedolfi3-May-01 5:46 
General"Cannot open file mfc42u.lib" Pin
Peter Jones3-May-01 5:42
Peter Jones3-May-01 5:42 
GeneralRe: Pin
Michael Dunn3-May-01 6:41
sitebuilderMichael Dunn3-May-01 6:41 
GeneralRe: Pin
Peter Jones3-May-01 7:28
Peter Jones3-May-01 7:28 
GeneralRe: Pin
Erik Thompson3-May-01 18:30
sitebuilderErik Thompson3-May-01 18:30 
Generalvisual c++ and thread Pin
3-May-01 5:31
suss3-May-01 5:31 

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.