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

C / C++ / MFC

 
GeneralRe: SAS Window: Winlogon.exe Application error. Pin
Mike Dimmick23-Sep-03 7:24
Mike Dimmick23-Sep-03 7:24 
GeneralDon't paint the blue "Hi-light" rectangle Pin
Urban Olars22-Sep-03 23:07
Urban Olars22-Sep-03 23:07 
GeneralRe: Don't paint the blue "Hi-light" rectangle Pin
Mike Dimmick23-Sep-03 0:03
Mike Dimmick23-Sep-03 0:03 
GeneralRe: Don't paint the blue "Hi-light" rectangle Pin
vcplusplus23-Sep-03 1:59
vcplusplus23-Sep-03 1:59 
GeneralRe: Don't paint the blue "Hi-light" rectangle Pin
Urban Olars23-Sep-03 9:12
Urban Olars23-Sep-03 9:12 
GeneralError in MS Help WorkShop Pin
bhargav_ram22-Sep-03 22:34
bhargav_ram22-Sep-03 22:34 
GeneralRe: Error in MS Help WorkShop Pin
Roger Allen23-Sep-03 2:14
Roger Allen23-Sep-03 2:14 
GeneralSocket Program Pin
esepich22-Sep-03 20:47
esepich22-Sep-03 20:47 
This code keeps on tripping the sendto(); failed if statement. I can't figure this out. Any help is much appreciated.

Thank you.

void CSSPingDlg::OnPing()
{
// TODO: Add your control notification handler code here
CIPAddressCtrl *ipaddressctrl = (CIPAddressCtrl *) GetDlgItem(IDC_IPADDRESS);
CEdit *editbox = (CEdit *) GetDlgItem(IDC_EDIT);
byte field1,field2,field3,field4;
char ipchar[100];

DWORD dip;
WSADATA wsaData;
SOCKET sock;
static ECHOREQUEST echo_req;
struct sockaddr_in sin;

ipaddressctrl->GetAddress(field1,field2,field3,field4);
sprintf(ipchar, "%d.%d.%d.%d",field1, field2, field3, field4);

dip = inet_addr(ipchar);

if (WSAStartup(MAKEWORD(2,2), &wsaData) != 0)
{
AfxMessageBox("WSAStartup failure!",MB_OK);
}
if ((sock = socket(AF_INET, SOCK_RAW, IPPROTO_ICMP)) == SOCKET_ERROR)
{
AfxMessageBox("Error starting socket",MB_OK);
}

sin.sin_family = AF_INET;
sin.sin_port = htons(0);
sin.sin_addr.s_addr = dip;

echo_req.icmpHdr.icmp_type = ICMP_ECHOREQ;
echo_req.icmpHdr.icmp_code = 0;
echo_req.icmpHdr.icmp_cksum = 0;
echo_req.icmpHdr.icmp_id = 1;
echo_req.icmpHdr.icmp_seq = 1;

memset(echo_req.cData, ' ', REQ_DATASIZE);
echo_req.icmpHdr.icmp_cksum = checksum((unsigned short *)&echo_req, sizeof(ECHOREQUEST));

if (sendto(sock, (const char *) &echo_req, sizeof(ECHOREQUEST), 0, (SOCKADDR *) dip, sizeof(SOCKADDR_IN)) == SOCKET_ERROR)
{
AfxMessageBox("sendto() failed: %d\n", MB_OK);
}

closesocket(sock);
WSACleanup();
}

GeneralRe: Socket Program Pin
Phil Speller22-Sep-03 22:22
Phil Speller22-Sep-03 22:22 
Generalprinting data in PDF format Pin
Bombi22-Sep-03 19:30
Bombi22-Sep-03 19:30 
QuestionHow to draw a line with mouse? Pin
whiteclouds22-Sep-03 18:01
whiteclouds22-Sep-03 18:01 
AnswerRe: How to draw a line with mouse? Pin
Blake Coverett22-Sep-03 18:11
Blake Coverett22-Sep-03 18:11 
GeneralRe: How to draw a line with mouse? Pin
whiteclouds22-Sep-03 18:28
whiteclouds22-Sep-03 18:28 
GeneralRe: How to draw a line with mouse? Pin
Blake Coverett22-Sep-03 21:34
Blake Coverett22-Sep-03 21:34 
GeneralRe: How to draw a line with mouse? Pin
whiteclouds22-Sep-03 23:06
whiteclouds22-Sep-03 23:06 
GeneralRe: How to draw a line with mouse? Pin
Blake Coverett22-Sep-03 23:39
Blake Coverett22-Sep-03 23:39 
GeneralA ridiculous beginners question Pin
Terry O'Nolley22-Sep-03 17:23
Terry O'Nolley22-Sep-03 17:23 
GeneralRe: A ridiculous beginners question Pin
Nish Nishant22-Sep-03 17:39
sitebuilderNish Nishant22-Sep-03 17:39 
GeneralRe: A ridiculous beginners question Pin
Terry O'Nolley22-Sep-03 17:54
Terry O'Nolley22-Sep-03 17:54 
GeneralRe: A ridiculous beginners question Pin
Nish Nishant22-Sep-03 18:19
sitebuilderNish Nishant22-Sep-03 18:19 
GeneralRe: A ridiculous beginners question Pin
Terry O'Nolley22-Sep-03 19:15
Terry O'Nolley22-Sep-03 19:15 
GeneralRe: A ridiculous beginners question Pin
Nish Nishant22-Sep-03 19:17
sitebuilderNish Nishant22-Sep-03 19:17 
GeneralRe: A ridiculous beginners question Pin
Terry O'Nolley23-Sep-03 7:53
Terry O'Nolley23-Sep-03 7:53 
GeneralRe: A ridiculous beginners question Pin
Michael Dunn22-Sep-03 17:58
sitebuilderMichael Dunn22-Sep-03 17:58 
GeneralRe: A ridiculous beginners question Pin
Terry O'Nolley22-Sep-03 18:15
Terry O'Nolley22-Sep-03 18:15 

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.