Click here to Skip to main content
15,892,746 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
JokeRe: How to calculate string width and height in pixel. Pin
Rajesh R Subramanian27-May-09 21:14
professionalRajesh R Subramanian27-May-09 21:14 
QuestionMFC VS2005 example Pin
Lju226-May-09 23:23
Lju226-May-09 23:23 
AnswerRe: MFC VS2005 example Pin
BangQ26-May-09 23:35
BangQ26-May-09 23:35 
AnswerRe: MFC VS2005 example Pin
Hamid_RT26-May-09 23:45
Hamid_RT26-May-09 23:45 
GeneralRe: MFC VS2005 example Pin
Lju227-May-09 0:27
Lju227-May-09 0:27 
GeneralRe: MFC VS2005 example Pin
Hamid_RT27-May-09 1:17
Hamid_RT27-May-09 1:17 
GeneralRe: MFC VS2005 example Pin
Lju227-May-09 1:19
Lju227-May-09 1:19 
QuestionOnKillFocus for frame windows Pin
prithaa26-May-09 23:01
prithaa26-May-09 23:01 
AnswerRe: OnKillFocus for frame windows Pin
«_Superman_»27-May-09 2:45
professional«_Superman_»27-May-09 2:45 
GeneralRe: OnKillFocus for frame windows Pin
prithaa28-May-09 0:59
prithaa28-May-09 0:59 
QuestionSize variation for a window Pin
prithaa26-May-09 22:45
prithaa26-May-09 22:45 
AnswerRe: Size variation for a window Pin
zakkas248327-May-09 0:29
zakkas248327-May-09 0:29 
Questioncould you help me? I need a example about how to using CSocket with mfc Pin
electric00926-May-09 22:10
electric00926-May-09 22:10 
AnswerRe: could you help me? I need a example about how to using CSocket with mfc Pin
ThatsAlok26-May-09 22:12
ThatsAlok26-May-09 22:12 
JokeRe: could you help me? I need a example about how to using CSocket with mfc Pin
CPallini26-May-09 22:28
mveCPallini26-May-09 22:28 
AnswerRe: could you help me? I need a example about how to using CSocket with mfc Pin
fanronghua26-May-09 22:43
fanronghua26-May-09 22:43 
That's simple.
//CListenSocket头文件
class CListenSocket : public CSocket
{
public:
CListenSocket(HWND hWnd=NULL);
HWND m_hWnd; //事件处理窗口
virtual void OnAccept(int nErrorCode);
};

//CListenSocket实现文件
#include "ListenSocket.h"
CListenSocket::CListenSocket(HWND hWnd){m_hWnd=hWnd;}
void CListenSocket::OnAccept(int nErrorCode)
{
SendMessage(m_hWnd,WM_SOCKET_MSG,SOCKET_CLNT_ACCEPT,0);
CSocket::OnAccept(nErrorCode);
}
...
m_pListenSocket=new CListenSocket(m_hWnd);
m_pListenSocket->Create(...);
m_pListenSocket->Listen();
...

LRESULT CXxxDlg::OnSocketMsg(WPARAM wParam, LPARAM lParam)
{
UINT type=(UINT)wParam;
switch(type)
{
case SOCKET_CLNT_ACCEPT:
{
CSocket* pSocket=new CSocket;
if(!m_pListenSocket->Accept(*pSocket))
{
delete pSocket;
break;
}
...
}
...
}
}
GeneralRe: could you help me? I need a example about how to using CSocket with mfc Pin
Hamid_RT26-May-09 23:02
Hamid_RT26-May-09 23:02 
GeneralRe: could you help me? I need a example about how to using CSocket with mfc Pin
BangQ26-May-09 23:31
BangQ26-May-09 23:31 
AnswerRe: could you help me? I need a example about how to using CSocket with mfc Pin
Hamid_RT26-May-09 22:59
Hamid_RT26-May-09 22:59 
GeneralRe: could you help me? I need a example about how to using CSocket with mfc Pin
JBAK_CP27-May-09 2:26
JBAK_CP27-May-09 2:26 
GeneralRe: could you help me? I need a example about how to using CSocket with mfc Pin
Hamid_RT27-May-09 3:30
Hamid_RT27-May-09 3:30 
AnswerRe: could you help me? I need a example about how to using CSocket with mfc Pin
David Crow27-May-09 3:54
David Crow27-May-09 3:54 
Questionusing a third party dll Pin
August Brower26-May-09 21:35
August Brower26-May-09 21:35 
AnswerRe: using a third party dll Pin
CPallini26-May-09 21:54
mveCPallini26-May-09 21:54 
AnswerRe: using a third party dll Pin
ThatsAlok26-May-09 22:14
ThatsAlok26-May-09 22:14 

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.