Click here to Skip to main content
15,911,646 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralC++ Standards Pin
Nish Nishant10-Sep-03 16:48
sitebuilderNish Nishant10-Sep-03 16:48 
GeneralRe: C++ Standards Pin
berndg10-Sep-03 22:29
berndg10-Sep-03 22:29 
GeneralRe: C++ Standards Pin
Brad Sokol11-Sep-03 3:46
Brad Sokol11-Sep-03 3:46 
GeneralRe: C++ Standards Pin
berndg11-Sep-03 3:56
berndg11-Sep-03 3:56 
GeneralIP Address of own PC Pin
R. Thomas10-Sep-03 16:04
R. Thomas10-Sep-03 16:04 
GeneralRe: IP Address of own PC Pin
ashxly10-Sep-03 16:13
ashxly10-Sep-03 16:13 
GeneralRe: IP Address of own PC Pin
R. Thomas10-Sep-03 16:49
R. Thomas10-Sep-03 16:49 
GeneralRe: IP Address of own PC (EDITED) Pin
John M. Drescher10-Sep-03 17:32
John M. Drescher10-Sep-03 17:32 
Try initializing winsock first:

#include "Winsock2.h"
#pragma comment(lib,"Ws2_32.lib")


int main(int argc, char* argv[])
{

WORD wVersionRequested;
WSADATA wsaData;
int err;
 
wVersionRequested = MAKEWORD( 2, 2 );
 
err = WSAStartup( wVersionRequested, &wsaData );
if ( err != 0 ) {
    /* Tell the user that we could not find a usable */
    /* WinSock DLL.                                  */
    return -1;
}

	char host[80];
	gethostname(host,80);
	LPHOSTENT lpHost;
	lpHost = gethostbyname(host);
	UINT ip = ((LPIN_ADDR)lpHost->h_addr)->s_addr;

        char* addr= inet_ntoa(*(LPIN_ADDR)lpHost->h_addr);
	
	return 0;
}


John
GeneralRe: IP Address of own PC (EDITED) Pin
R. Thomas10-Sep-03 18:02
R. Thomas10-Sep-03 18:02 
GeneralRe: IP Address of own PC (EDITED) Pin
John M. Drescher10-Sep-03 18:10
John M. Drescher10-Sep-03 18:10 
GeneralRe: IP Address of own PC (EDITED) Pin
John M. Drescher10-Sep-03 18:23
John M. Drescher10-Sep-03 18:23 
GeneralRe: IP Address of own PC (EDITED) Pin
R. Thomas10-Sep-03 18:50
R. Thomas10-Sep-03 18:50 
GeneralRe: IP Address of own PC (EDITED) Pin
John M. Drescher10-Sep-03 19:03
John M. Drescher10-Sep-03 19:03 
GeneralRe: IP Address of own PC (EDITED) Pin
R. Thomas10-Sep-03 19:29
R. Thomas10-Sep-03 19:29 
GeneralRe: IP Address of own PC (EDITED) Pin
John M. Drescher10-Sep-03 19:37
John M. Drescher10-Sep-03 19:37 
GeneralRe: IP Address of own PC (EDITED) Pin
R. Thomas10-Sep-03 19:50
R. Thomas10-Sep-03 19:50 
GeneralRe: IP Address of own PC (EDITED) Pin
Phil Speller10-Sep-03 23:33
Phil Speller10-Sep-03 23:33 
GeneralRe: IP Address of own PC (EDITED) Pin
John M. Drescher11-Sep-03 4:04
John M. Drescher11-Sep-03 4:04 
Questionquestion on OLEDB?? Pin
ashxly10-Sep-03 15:46
ashxly10-Sep-03 15:46 
GeneralNeed some Help -- Kinda of Dense! Pin
Larry J. Siddens10-Sep-03 15:36
Larry J. Siddens10-Sep-03 15:36 
GeneralRe: Need some Help -- Kinda of Dense! Pin
PengFeidu10-Sep-03 20:52
PengFeidu10-Sep-03 20:52 
GeneralRe: Need some Help -- Kinda of Dense! Pin
Larry J. Siddens11-Sep-03 2:56
Larry J. Siddens11-Sep-03 2:56 
GeneralMinimizing Pin
Dov Sherman10-Sep-03 14:38
Dov Sherman10-Sep-03 14:38 
GeneralRe: Minimizing Pin
Michael Dunn10-Sep-03 14:54
sitebuilderMichael Dunn10-Sep-03 14:54 
Questionhow to link dialog to database Pin
coda_x10-Sep-03 14:13
coda_x10-Sep-03 14:13 

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.