Click here to Skip to main content
15,879,535 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
GeneralRe: OCX Rename Pin
Stephen Hewitt1-Sep-10 4:54
Stephen Hewitt1-Sep-10 4:54 
GeneralRe: OCX Rename Pin
Cool_Dev1-Sep-10 5:06
Cool_Dev1-Sep-10 5:06 
GeneralRe: OCX Rename Pin
Sauro Viti1-Sep-10 5:55
professionalSauro Viti1-Sep-10 5:55 
GeneralRe: OCX Rename Pin
Cool_Dev2-Sep-10 3:38
Cool_Dev2-Sep-10 3:38 
QuestionOCX Rename [modified] Pin
Member 74114223-Sep-10 0:13
Member 74114223-Sep-10 0:13 
AnswerRe: OCX Rename Pin
Cool_Dev3-Sep-10 3:05
Cool_Dev3-Sep-10 3:05 
Questionre:lookng for winsock tcp communications example Pin
Alan Kurlansky30-Aug-10 10:50
Alan Kurlansky30-Aug-10 10:50 
AnswerRe: re:lookng for winsock tcp communications example Pin
Moak30-Aug-10 11:56
Moak30-Aug-10 11:56 
Have a look at Beej's guide to networking programming[^], there are client/server examples in chapter 6.
Another starting point is the Winsock Programmer's FAQ[^], it has examples in section 6.

Regarding a server, the normal way would be opening a server socket, calling bind and listen and then accepting incoming client connections. You do not close the server socket, while more incoming connections are expected. Here is a code fragment (your code could look different, but the principle stays the same):
void CSocketServer::OnAccept(int nErrorCode) 
{ 
    CAsyncNetwork::OnAccept(nErrorCode); 
    CAsyncNetwork* pSocket = new CAsyncNetwork; 
    if(Accept(*pSocket))
    { 
        m_listSockets.push_back(pSocket); //list of sockets
    } else { 
        delete pSocket;                   //handle error case
    } 
}

CSocketServer server; 
server.Open();  
server.Bind(4242); //listening port of server
server.Listen(); 


Hope this helps. Smile | :)
/Moak

QuestionDoes anyone know Interface of Microsoft DataGrid Control?(ActiveX Control) Pin
dancingfish24-Aug-10 17:20
dancingfish24-Aug-10 17:20 
AnswerRe: Does anyone know Interface of Microsoft DataGrid Control?(ActiveX Control) Pin
Cool_Dev28-Aug-10 3:03
Cool_Dev28-Aug-10 3:03 
Questionwindows Visual Studio C++/Visual Basic file locking Pin
Alan Kurlansky16-Aug-10 10:49
Alan Kurlansky16-Aug-10 10:49 
AnswerRe: windows Visual Studio C++/Visual Basic file locking Pin
«_Superman_»16-Aug-10 18:56
professional«_Superman_»16-Aug-10 18:56 
AnswerRe: windows Visual Studio C++/Visual Basic file locking Pin
Cool_Dev28-Aug-10 3:12
Cool_Dev28-Aug-10 3:12 
AnswerRe: windows Visual Studio C++/Visual Basic file locking Pin
cmk30-Aug-10 18:28
cmk30-Aug-10 18:28 
QuestionActiveX without prompting? (or how to create an IE-plugin?) Pin
Don Rolando15-Aug-10 20:44
Don Rolando15-Aug-10 20:44 
AnswerRe: ActiveX without prompting? (or how to create an IE-plugin?) Pin
Cool_Dev28-Aug-10 3:00
Cool_Dev28-Aug-10 3:00 
QuestionC++ MFC - DatePickerControl - DTN_DATETIMECHANGE event getting triggered twice when clicked !!!! [modified] Pin
Kausik4u11-Aug-10 8:54
Kausik4u11-Aug-10 8:54 
AnswerRe: C++ MFC - DatePickerControl - DTN_DATETIMECHANGE event getting triggered twice when clicked !!!! Pin
Stuart Dootson12-Aug-10 4:17
professionalStuart Dootson12-Aug-10 4:17 
GeneralRe: C++ MFC - DatePickerControl - DTN_DATETIMECHANGE event getting triggered twice when clicked !!!! Pin
Kausik4u12-Aug-10 4:27
Kausik4u12-Aug-10 4:27 
QuestionTranlating old code to the STL style Pin
VeganFanatic8-Aug-10 4:47
VeganFanatic8-Aug-10 4:47 
AnswerRe: Tranlating old code to the STL style Pin
Stuart Dootson12-Aug-10 4:13
professionalStuart Dootson12-Aug-10 4:13 
GeneralRe: Tranlating old code to the STL style Pin
VeganFanatic12-Aug-10 8:33
VeganFanatic12-Aug-10 8:33 
GeneralRe: Tranlating old code to the STL style Pin
Stuart Dootson12-Aug-10 8:51
professionalStuart Dootson12-Aug-10 8:51 
GeneralRe: Tranlating old code to the STL style Pin
VeganFanatic12-Aug-10 8:56
VeganFanatic12-Aug-10 8:56 
GeneralRe: Tranlating old code to the STL style Pin
Stuart Dootson12-Aug-10 9:16
professionalStuart Dootson12-Aug-10 9:16 

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.