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

C / C++ / MFC

 
GeneralRe: how to find running .bat file Pin
ktvije7-Dec-03 6:06
ktvije7-Dec-03 6:06 
Generala error i can't understand Pin
muddog5-Dec-03 20:58
muddog5-Dec-03 20:58 
GeneralRe: a error i can't understand Pin
Johnny ²5-Dec-03 22:00
Johnny ²5-Dec-03 22:00 
GeneralRe: a error i can't understand Pin
Michael Dunn6-Dec-03 0:26
sitebuilderMichael Dunn6-Dec-03 0:26 
GeneralReminder Tool Pin
Monty25-Dec-03 20:48
Monty25-Dec-03 20:48 
GeneralRe: Reminder Tool Pin
Ph@ntom5-Dec-03 21:05
Ph@ntom5-Dec-03 21:05 
QuestionHow to resolve a url name Pin
BaldwinMartin5-Dec-03 19:51
BaldwinMartin5-Dec-03 19:51 
AnswerRe: How to resolve a url name Pin
Ph@ntom5-Dec-03 20:37
Ph@ntom5-Dec-03 20:37 
#include <winsock.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main(int argc, int **argv)
{
WSADATA wsda; // Structure to store info
// returned from WSAStartup

struct hostent *host; // Used to store information
// retreived about the server
char szAddress[64];
int i;

// Check arguments
if(argc != 2 ||
(argc==2 && strcmp((char *) &argv[1][0], "/?")==0))
{
printf("resolver domain\n");
printf(" domain: the domain name that you want to resolve\n");
exit(1);
}

// Copy the IP address
strcpy(szAddress, (char *) &argv[1][0]);

// Load version 1.1 of Winsock

WSAStartup(MAKEWORD(1,1), &wsda);
host = NULL;
printf("Resolving host...");
host = gethostbyname(szAddress); // Get the IP address of the server
// and store it in host
if(host == NULL)
{
printf("Error\nUnknown host: %s\n", szAddress);
exit(1);
}
printf("OK\n");

printf("host->h_name = %s\n", host->h_name);

i = 0;
while(host->h_aliases[i] != NULL)
{
printf("host->h_aliases[%d] = %s\n", i, host->h_aliases[i]);
i++;
}

printf("host->h_addrtype = %d\n", host->h_addrtype);
printf("host->h_length = %d\n", host->h_length);

i = 0;
while(host->h_addr_list[i] != NULL)
{
printf("host->h_addr_list[%d] = 0x%X (%s)\n",
i,
(long) host->h_addr_list[i],
inet_ntoa(*(struct in_addr *) host->h_addr_list[i]));
i++;
}

WSACleanup();

return 0;
}

The Phantom.
GeneralRe: How to resolve a url name Pin
BaldwinMartin6-Dec-03 0:46
BaldwinMartin6-Dec-03 0:46 
GeneralProblem with RichEdit Pin
Ph@ntom5-Dec-03 19:33
Ph@ntom5-Dec-03 19:33 
Generalproblem with dialog scrolls Pin
coda_x5-Dec-03 15:12
coda_x5-Dec-03 15:12 
GeneralRe: problem with dialog scrolls Pin
Monty25-Dec-03 20:17
Monty25-Dec-03 20:17 
GeneralPrefered base Address. Pin
Prakash Nadar5-Dec-03 14:32
Prakash Nadar5-Dec-03 14:32 
GeneralRe: Prefered base Address. Pin
cmk5-Dec-03 19:33
cmk5-Dec-03 19:33 
GeneralRe: Prefered base Address. Pin
Prakash Nadar5-Dec-03 21:04
Prakash Nadar5-Dec-03 21:04 
GeneralRe: Prefered base Address. Pin
cmk5-Dec-03 22:06
cmk5-Dec-03 22:06 
GeneralRe: Prefered base Address. Pin
Prakash Nadar5-Dec-03 22:44
Prakash Nadar5-Dec-03 22:44 
GeneralRe: Prefered base Address. Pin
cmk5-Dec-03 23:42
cmk5-Dec-03 23:42 
GeneralRe: Prefered base Address. Pin
Bo Hunter6-Dec-03 11:11
Bo Hunter6-Dec-03 11:11 
GeneralRe: Prefered base Address. Pin
Prakash Nadar6-Dec-03 14:47
Prakash Nadar6-Dec-03 14:47 
GeneralByte swapping questions Pin
fuzzbuzz5-Dec-03 14:24
fuzzbuzz5-Dec-03 14:24 
GeneralRe: Byte swapping questions Pin
cmk5-Dec-03 19:41
cmk5-Dec-03 19:41 
Generaldoc/view question in MDI Pin
rkhuang5-Dec-03 14:06
rkhuang5-Dec-03 14:06 
GeneralRe: doc/view question in MDI Pin
kjessee5-Dec-03 15:11
kjessee5-Dec-03 15:11 
GeneralQuestion regarding Getting File Path Pin
Deepak Samuel5-Dec-03 13:56
Deepak Samuel5-Dec-03 13:56 

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.