|
-
January 2nd, 2009, 02:13 AM
#1
Why does this error occur???
I am coding to make UDP communication among computers.
I just take the local port no from the user & create the socket. But, I get the screen with
this message............
TODO: <File description> has encountered a problem and needs to close. We are sorry for the inconvenience.
The debugger does not enter in the if loop also..it goes to if statement execute it & shows that screen.
The code I used is...........
void CUDPTry2Dlg::OnCreateSocket()
{
UpdateData(TRUE);
m_sendBuffer = ""; //for async send
m_nBytesSent = 0;
m_nBytesBufferSize = 0;
if ( !UDPptr -> Create( m_LocalPort, SOCK_DGRAM ) )
{
wsprintf(m_szError, "Failed to create UDP socket: %d! Close and restart app.",
UDPptr->GetLastError());
delete UDPptr;
UDPptr = NULL;
AfxMessageBox ( m_szError );
return;
}
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|