Click here to Skip to main content
15,919,434 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralFonts are scaled while scaling metafile Pin
marukas20-Jan-05 23:42
marukas20-Jan-05 23:42 
QuestionNeed help!!! How to create a connection in Network connections in WinXP? Pin
Chuaaico20-Jan-05 23:42
Chuaaico20-Jan-05 23:42 
GeneralHelp wanted with CRecordset Pin
xcavin20-Jan-05 21:15
xcavin20-Jan-05 21:15 
GeneralRe: Help wanted with CRecordset Pin
David Crow21-Jan-05 10:15
David Crow21-Jan-05 10:15 
GeneralGetKeyState Pin
vidhyas20-Jan-05 17:06
vidhyas20-Jan-05 17:06 
GeneralRe: GetKeyState Pin
Blake Miller21-Jan-05 8:53
Blake Miller21-Jan-05 8:53 
Generalabout WM_DEVCHANGE notification Pin
gly20-Jan-05 15:57
gly20-Jan-05 15:57 
GeneralWSAAsyncSelect CANNOT post socket event notifications, Plz help... Pin
enoloo_don20-Jan-05 14:48
enoloo_don20-Jan-05 14:48 
I wrote a class CClientSocket for async-sockets communication, and a class CSockWnd to receive socket event notifications. But when a CClientSocket object works, CSockWnd cannot receive any notifications. I'm sure that CClientSocket can send/receive data, and "SendMessage((HWND)(*CSockWnd::GetInstance()), WM_CLIENTSOCKET, m_hSocket, FD_CONNECT);" can work. But CSockWnd cannot receive notifications from system when net events coming.

Some codes here:

/* Create a socket, and call WSAAsyncSelect. */
// Create a local socket
m_hSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_IP);
if(m_hSocket == INVALID_SOCKET)
{
m_strLastError = TEXT("CClientSocket::Connect::socket failed.");
ReportError(ERROR_LEVEL_INFORMATION, m_strLastError.c_str());
return FALSE;
}

// singleton, attach this to CSockWnd; and CSockWnd can callback this when net events coming.
CSockWnd::GetInstance()->Attach(this);

// call WSAAsyncSelect
if(WSAAsyncSelect(m_hSocket, (HWND)(*CSockWnd::GetInstance()), WM_CLIENTSOCKET, FD_READ | FD_CLOSE | FD_CONNECT))
{
m_strLastError = TEXT("CClientSocket::Connect::WSAAsycSelect failed.");
ReportError(ERROR_LEVEL_INFORMATION, m_strLastError.c_str());
return FALSE;
}

In addition, all classes work in a win32 DLL.
QuestionADO with RecordBinding Question ? Pin
Anonymous20-Jan-05 14:43
Anonymous20-Jan-05 14:43 
QuestionHow to detect the activity of specified devices? Pin
ErisonWu20-Jan-05 14:02
ErisonWu20-Jan-05 14:02 
GeneralThe hell of LBN_ERRSPACE Pin
Alfonso Vila20-Jan-05 13:52
Alfonso Vila20-Jan-05 13:52 
GeneralRe: The hell of LBN_ERRSPACE Pin
Shog920-Jan-05 14:34
sitebuilderShog920-Jan-05 14:34 
Generalsystem tray right-click menu Pin
Anonymous20-Jan-05 13:42
Anonymous20-Jan-05 13:42 
GeneralRe: system tray right-click menu Pin
nm_11420-Jan-05 18:01
nm_11420-Jan-05 18:01 
GeneralRe: system tray right-click menu Pin
lillah21-Jan-05 0:03
lillah21-Jan-05 0:03 
GeneralRe: system tray right-click menu Pin
Anonymous21-Jan-05 13:16
Anonymous21-Jan-05 13:16 
GeneralDevelop FTA Tool Help Pin
XiaoYu20-Jan-05 13:41
XiaoYu20-Jan-05 13:41 
Questionhow to get the usb device's disk name,like "H:"? Pin
lowiq20-Jan-05 13:41
lowiq20-Jan-05 13:41 
GeneralCatching Keyboard events Pin
FayezElFar20-Jan-05 11:47
FayezElFar20-Jan-05 11:47 
GeneralRe: Catching Keyboard events Pin
Blake Miller21-Jan-05 8:59
Blake Miller21-Jan-05 8:59 
GeneralNo Updates When Loss Focus Pin
Grahamfff20-Jan-05 10:26
Grahamfff20-Jan-05 10:26 
GeneralRe: No Updates When Loss Focus Pin
Mircea Puiu21-Jan-05 0:24
Mircea Puiu21-Jan-05 0:24 
GeneralRe: No Updates When Loss Focus Pin
Grahamfff22-Jan-05 10:10
Grahamfff22-Jan-05 10:10 
QuestionCall OnClose or PostNcDestroy? Pin
Anonymous20-Jan-05 10:03
Anonymous20-Jan-05 10:03 
AnswerRe: Call OnClose or PostNcDestroy? Pin
Blake Miller20-Jan-05 11:12
Blake Miller20-Jan-05 11:12 

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.