Click here to Skip to main content
15,915,091 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How to get ASCII Character from Decimal value Pin
toxcct18-Jun-08 3:04
toxcct18-Jun-08 3:04 
AnswerRe: How to get ASCII Character from Decimal value Pin
CPallini18-Jun-08 3:13
mveCPallini18-Jun-08 3:13 
QuestionRe: How to get ASCII Character from Decimal value Pin
James R. Twine18-Jun-08 3:35
James R. Twine18-Jun-08 3:35 
QuestionProperty Sheet eVC++ WinCE - Urgent Pin
Trupti Mehta18-Jun-08 2:54
Trupti Mehta18-Jun-08 2:54 
Questionget internal ip, getaddrinfo() Pin
smedowns7718-Jun-08 2:50
smedowns7718-Jun-08 2:50 
QuestionRe: get internal ip, getaddrinfo() Pin
David Crow18-Jun-08 2:57
David Crow18-Jun-08 2:57 
AnswerRe: get internal ip, getaddrinfo() Pin
Jijo.Raj18-Jun-08 3:01
Jijo.Raj18-Jun-08 3:01 
AnswerRe: get internal ip, getaddrinfo() Pin
Mark Salsbery18-Jun-08 10:23
Mark Salsbery18-Jun-08 10:23 
A given host can have more than one address.

Here's a simple IP v4 example:
char hostname[256];
if (0 == ::gethostname(hostname, sizeof(hostname)))
{
	addrinfo aihints;
	addrinfo *ailist = NULL;

	memset(&aihints, 0, sizeof(aihints));
	aihints.ai_family = AF_INET;
	aihints.ai_socktype = SOCK_STREAM;
	aihints.ai_protocol = IPPROTO_TCP;

	if (::getaddrinfo(hostname, NULL, &aihints, &ailist) == 0) 
	{
		addrinfo *paddrinfo = ailist;
		while (paddrinfo)
		{
			// get ip address in a structure
			sockaddr_in *paddr_in = (sockaddr_in *)paddrinfo->ai_addr;

			// get ip address as a string
			char *pipstring = inet_ntoa(paddr_in->sin_addr);

			paddrinfo = paddrinfo->ai_next;
		}

		::freeaddrinfo(ailist);
	}
}

Mark

Mark Salsbery
Microsoft MVP - Visual C++

Java | [Coffee]

QuestionKeyboard messages not received by my window Pin
theCPkid18-Jun-08 2:24
theCPkid18-Jun-08 2:24 
QuestionDynamic Data Exchange using C++ : Urgent Pin
Vishrant Shah18-Jun-08 0:38
Vishrant Shah18-Jun-08 0:38 
GeneralUrgent? No cookie for you... Pin
CPallini18-Jun-08 1:41
mveCPallini18-Jun-08 1:41 
AnswerRe: Dynamic Data Exchange using C++ : Urgent Pin
Alan Balkany18-Jun-08 3:36
Alan Balkany18-Jun-08 3:36 
QuestionHow to dial a phone number ??? Pin
tina->newcoder18-Jun-08 0:32
tina->newcoder18-Jun-08 0:32 
AnswerRe: How to dial a phone number ??? Pin
Hamid_RT18-Jun-08 0:40
Hamid_RT18-Jun-08 0:40 
GeneralRe: How to dial a phone number ??? Pin
tina->newcoder18-Jun-08 0:49
tina->newcoder18-Jun-08 0:49 
GeneralRe: How to dial a phone number ??? Pin
Hamid_RT18-Jun-08 1:02
Hamid_RT18-Jun-08 1:02 
GeneralRe: How to dial a phone number ??? Pin
David Crow18-Jun-08 3:21
David Crow18-Jun-08 3:21 
GeneralRe: How to dial a phone number ??? Pin
tina->newcoder18-Jun-08 1:02
tina->newcoder18-Jun-08 1:02 
AnswerRe: How to dial a phone number ??? Pin
Cedric Moonen18-Jun-08 0:59
Cedric Moonen18-Jun-08 0:59 
GeneralRe: How to dial a phone number ??? Pin
tina->newcoder18-Jun-08 1:08
tina->newcoder18-Jun-08 1:08 
GeneralRe: How to dial a phone number ??? Pin
Rajesh R Subramanian18-Jun-08 1:15
professionalRajesh R Subramanian18-Jun-08 1:15 
GeneralRe: How to dial a phone number ??? Pin
Hamid_RT18-Jun-08 1:28
Hamid_RT18-Jun-08 1:28 
JokeRe: How to dial a phone number ??? Pin
Maximilien18-Jun-08 1:32
Maximilien18-Jun-08 1:32 
AnswerRe: How to dial a phone number ??? Pin
tina->newcoder18-Jun-08 1:31
tina->newcoder18-Jun-08 1:31 
GeneralRe: How to dial a phone number ??? Pin
tina->newcoder18-Jun-08 1:39
tina->newcoder18-Jun-08 1:39 

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.