Click here to Skip to main content
16,008,750 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: wierd problems w/ vC++ , help ?! :) Pin
joshfl4-Dec-02 8:02
joshfl4-Dec-02 8:02 
GeneralRe: wierd problems w/ vC++ , help ?! :) Pin
Christian Graus4-Dec-02 8:47
protectorChristian Graus4-Dec-02 8:47 
QuestionHow to change caption of Property Page Pin
Alois Kraus3-Dec-02 6:57
Alois Kraus3-Dec-02 6:57 
AnswerRe: How to change caption of Property Page Pin
Navin3-Dec-02 7:30
Navin3-Dec-02 7:30 
AnswerYay, I figured it out! Pin
Navin3-Dec-02 7:45
Navin3-Dec-02 7:45 
GeneralRe: Yay, I figured it out! Pin
Alois Kraus4-Dec-02 0:58
Alois Kraus4-Dec-02 0:58 
AnswerRe: How to change caption of Property Page Pin
Andrew Hafen3-Dec-02 7:51
Andrew Hafen3-Dec-02 7:51 
GeneralMFC Sockets - Urgent!!! Pin
Vladimir Georgiev3-Dec-02 6:51
Vladimir Georgiev3-Dec-02 6:51 
The following is my code:

CAsyncSocket socksrv;
char buff[500];

...

UINT ClientThread(LPVOID lParam)
{
CSocket* s = new CSocket;
s = (CSocket*) lParam;

while (1) {
s->Receive(buff, 500*sizeof(char), 0);
if (strlen(buff)) {
::SetFocus(NULL);
AfxMessageBox(buff);
}
}

return 0;
}

UINT ServerThread(LPVOID lParam)
{
CSocket s;

socksrv.Create(55599);
socksrv.Listen();

while (1) {
if (socksrv.Accept(s)) {
AfxBeginThread(ClientThread, (LPVOID) &s);
}
}
return 0;
}


void CServerDlg::OnStartServer()
{
AfxBeginThread(ServerThread, NULL);
}


When I execute the following, and try to connect the client, an exception occurs. Please tell me where my mistake is, and if you know what the multithreading sequence must be using CSocket or CAsyncSocket...

Thank you!

"Needless redundancy is the hobgoblin of software engineering." - Peter Darnell
GeneralRe: MFC Sockets - Urgent!!! Pin
Shamoon3-Dec-02 7:00
Shamoon3-Dec-02 7:00 
Questionhow to receive activity notification for dynamically created CComboBox? Pin
Anonymous3-Dec-02 6:39
Anonymous3-Dec-02 6:39 
AnswerRe: how to receive activity notification for dynamically created CComboBox? Pin
Roger Allen4-Dec-02 2:00
Roger Allen4-Dec-02 2:00 
GeneralWindows CE: adding popup menu to lower menubar (which is a toolbar) Pin
Anonymous3-Dec-02 6:34
Anonymous3-Dec-02 6:34 
GeneralRender html to image Pin
roel_3-Dec-02 6:25
roel_3-Dec-02 6:25 
GeneralRe: Render html to image Pin
Scott H. Settlemier3-Dec-02 6:39
Scott H. Settlemier3-Dec-02 6:39 
GeneralRe: Render html to image Pin
Scott H. Settlemier3-Dec-02 6:44
Scott H. Settlemier3-Dec-02 6:44 
GeneralRe: Render html to image Pin
roel_3-Dec-02 23:57
roel_3-Dec-02 23:57 
GeneralRe: Render html to image Pin
dabs3-Dec-02 8:50
dabs3-Dec-02 8:50 
GeneralRe: Render html to image Pin
roel_3-Dec-02 23:58
roel_3-Dec-02 23:58 
GeneralCheck State of a CButton Pin
Jon Swain3-Dec-02 6:10
Jon Swain3-Dec-02 6:10 
GeneralRe: Check State of a CButton Pin
valikac3-Dec-02 9:09
valikac3-Dec-02 9:09 
Questionconvert string? Pin
Member 1043933-Dec-02 6:04
Member 1043933-Dec-02 6:04 
AnswerRe: convert string? Pin
Anonymous3-Dec-02 6:09
Anonymous3-Dec-02 6:09 
GeneralRe: convert string? Pin
Member 1043933-Dec-02 6:19
Member 1043933-Dec-02 6:19 
GeneralRe: convert string? Pin
Nick Parker3-Dec-02 8:00
protectorNick Parker3-Dec-02 8:00 
GeneralRe: convert string? Pin
Anonymous3-Dec-02 11:42
Anonymous3-Dec-02 11:42 

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.