Click here to Skip to main content
15,914,013 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Get all controls on a form Pin
David Crow3-Jul-07 2:04
David Crow3-Jul-07 2:04 
GeneralRe: Get all controls on a form Pin
braune3-Jul-07 7:11
braune3-Jul-07 7:11 
GeneralRe: Get all controls on a form Pin
braune3-Jul-07 7:18
braune3-Jul-07 7:18 
QuestionCopy Constuctor Pin
tom groezer29-Jun-07 21:42
tom groezer29-Jun-07 21:42 
AnswerRe: Copy Constuctor Pin
fefe.wyx30-Jun-07 0:02
fefe.wyx30-Jun-07 0:02 
AnswerRe: Copy Constuctor Pin
bob1697230-Jun-07 7:24
bob1697230-Jun-07 7:24 
QuestionRe: Copy Constuctor Pin
David Crow2-Jul-07 5:09
David Crow2-Jul-07 5:09 
QuestionApplication Error The Exception BreakPoint Pin
shivditya29-Jun-07 20:07
shivditya29-Jun-07 20:07 
A task infront of me is to develop local chat server
which will just accept data from everyone and pass it to person whom it is to be send.
Server compiles fine but as soon as I run it ,it fails. Errors come at Accept statement.
The requirement is due to internet is not allowed.
And way for instant communication is required as comapany
layout is very complecated to reach from one room to other. Official mail is too inconvenient for small messages.

//CSocket cs,cr[500]; defined in h file
// bool connected;

BOOL CChatserverDlg::OnInitDialog()
{
CDialog::OnInitDialog();
---------------
------------------
----------------
count = 0;
connected = false;
connected = cs.Create(4000,SOCK_STREAM);
SilentWork();
return TRUE;
}

void CChatserverDlg::SilentWork()
{
bool check = false;
check = cs.Listen();
for(int i = 0;i < 500;i++) //even I reduce number error comes
{
AfxBeginThread(&thread,0);
count++;
}

}


UINT thread(LPVOID p)
{
CChatserverDlg* dlg = (CChatserverDlg*)AfxGetApp()->GetMainWnd();
SOCKADDR* lpSockAddr;
dlg->cs.Accept(dlg->cr[count],lpSockAddr );
while(dlg->connected)
{
ULONG nBytesToReceive=0;
DWORD dwErr;
if( !dlg->cr[count].IOCtl(FIONREAD, &nBytesToReceive))
{
dwErr = WSAGetLastError();
}
if( nBytesToReceive==0 )
{ }
else
{
char* buff = new char[15];
try
{
dlg->cr[count].Receive(buff,15,0);
}
catch(CException e)
{
}
dlg->m_ldList1.AddString(buff);
char* data = new char[1024];
bool continueloop = true;
do
{
ULONG ToReceive=0;
if( !dlg->cr[count].IOCtl(FIONREAD, &ToReceive))
{
dwErr = WSAGetLastError();
}
if( ToReceive==0 )
{ }
else
{
dlg->cr[count].Receive(data,1023,0);
dlg->cr[count].SendTo(data,1023,4000,buff,0);
if(NULL != strstr("diconnected",data))
continueloop = false;
}
}while(continueloop);



|| ART OF LIVING ||

QuestionRe: Application Error The Exception BreakPoint Pin
David Crow2-Jul-07 5:12
David Crow2-Jul-07 5:12 
AnswerRe: Application Error The Exception BreakPoint Pin
shivditya8-Jul-07 1:05
shivditya8-Jul-07 1:05 
QuestionMakefile.def not found Pin
MANOJ BATRA29-Jun-07 20:00
MANOJ BATRA29-Jun-07 20:00 
Questionsetting checks on checkbox , setcheck not working Pin
awah29-Jun-07 19:18
awah29-Jun-07 19:18 
AnswerRe: setting checks on checkbox , setcheck not working Pin
Hamid_RT30-Jun-07 0:35
Hamid_RT30-Jun-07 0:35 
QuestionRe: setting checks on checkbox , setcheck not working Pin
David Crow2-Jul-07 5:13
David Crow2-Jul-07 5:13 
QuestionGreek character in ascii? Pin
acerunner31629-Jun-07 12:00
acerunner31629-Jun-07 12:00 
AnswerRe: Greek character in ascii? Pin
Christian Graus29-Jun-07 12:37
protectorChristian Graus29-Jun-07 12:37 
GeneralRe: Greek character in ascii? Pin
acerunner31629-Jun-07 12:47
acerunner31629-Jun-07 12:47 
GeneralRe: Greek character in ascii? Pin
markkuk29-Jun-07 20:15
markkuk29-Jun-07 20:15 
GeneralRe: Greek character in ascii? Pin
acerunner31629-Jun-07 13:34
acerunner31629-Jun-07 13:34 
QuestionInput Method Development Pin
leejwen29-Jun-07 11:56
leejwen29-Jun-07 11:56 
AnswerRe: Input Method Development Pin
Rajesh R Subramanian29-Jun-07 21:47
professionalRajesh R Subramanian29-Jun-07 21:47 
QuestionUnix Source Code Pin
KARFER29-Jun-07 7:51
KARFER29-Jun-07 7:51 
AnswerRe: Unix Source Code Pin
led mike29-Jun-07 7:57
led mike29-Jun-07 7:57 
JokeRe: Unix Source Code Pin
Hamid_RT29-Jun-07 9:32
Hamid_RT29-Jun-07 9:32 
AnswerRe: Unix Source Code Pin
Hamid_RT29-Jun-07 9:32
Hamid_RT29-Jun-07 9:32 

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.