Click here to Skip to main content
16,009,847 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Font Coloring Preview Pin
Ravi Bhavnani11-Apr-03 7:06
professionalRavi Bhavnani11-Apr-03 7:06 
GeneralRe: Font Coloring Preview Pin
Jonah Bishop11-Apr-03 7:40
Jonah Bishop11-Apr-03 7:40 
GeneralC++ tokenizer Pin
naja11-Apr-03 6:05
naja11-Apr-03 6:05 
GeneralRe: C++ tokenizer Pin
Toni7811-Apr-03 22:50
Toni7811-Apr-03 22:50 
QuestionHow can I get the IP of my server? Pin
Salvador Dali11-Apr-03 5:17
Salvador Dali11-Apr-03 5:17 
AnswerRe: How can I get the IP of my server? Pin
Peter Weyzen11-Apr-03 6:35
Peter Weyzen11-Apr-03 6:35 
GeneralRe: How can I get the IP of my server? Pin
Salvador Dali11-Apr-03 7:17
Salvador Dali11-Apr-03 7:17 
GeneralRe: How can I get the IP of my server? Pin
Peter Weyzen11-Apr-03 7:28
Peter Weyzen11-Apr-03 7:28 
let me write that in code, maybe you'll see it this way:

// step 1: get my host name:
char hostName[128];
gethostname( hostName, sizeof(hostName) );

// step 2: convert my host name to an address table
const hostent *pHostRecord = gethostbyname( hostName );

// step 3: grab the first address out of the table.
DWORD ip = *(DWORD *)pHostRecord->h_addr_list[0];


it's not a perfect answer, and get's weird when your machine has more than one IP address (multiple NICs). But in general, this works great.

use "inetntoa()" to convert the DWORD ip to a dotted IP string.
GeneralRe: How can I get the IP of my server? Pin
Salvador Dali11-Apr-03 22:42
Salvador Dali11-Apr-03 22:42 
GeneralMulti-dimensional Arrays Pin
ed111-Apr-03 4:44
ed111-Apr-03 4:44 
GeneralRe: Multi-dimensional Arrays Pin
valikac11-Apr-03 4:50
valikac11-Apr-03 4:50 
GeneralRe: Multi-dimensional Arrays Pin
Martyn Pearson11-Apr-03 5:31
Martyn Pearson11-Apr-03 5:31 
GeneralRe: Multi-dimensional Arrays Pin
ed111-Apr-03 5:58
ed111-Apr-03 5:58 
GeneralRe: Multi-dimensional Arrays Pin
jmkhael11-Apr-03 13:54
jmkhael11-Apr-03 13:54 
GeneralRe: Multi-dimensional Arrays Pin
ed114-Apr-03 3:09
ed114-Apr-03 3:09 
GeneralGetting the Bitmap of a font using GDI andMFC Pin
cod3r11-Apr-03 2:28
cod3r11-Apr-03 2:28 
Generalsyslistview32 Pin
_crs_11-Apr-03 2:23
_crs_11-Apr-03 2:23 
GeneralRe: syslistview32 Pin
cubiq11-Apr-03 11:07
cubiq11-Apr-03 11:07 
GeneralVC++ 6.0/ATL/COM Pin
Duncan Wells11-Apr-03 1:58
Duncan Wells11-Apr-03 1:58 
GeneralRe: VC++ 6.0/ATL/COM Pin
Zdeslav Vojkovic11-Apr-03 2:32
Zdeslav Vojkovic11-Apr-03 2:32 
GeneralUsing the windows shell "Open with" .... Pin
Phil.Benson11-Apr-03 1:40
professionalPhil.Benson11-Apr-03 1:40 
GeneralRe: Using the windows shell "Open with" .... Pin
Hans Ruck11-Apr-03 4:39
Hans Ruck11-Apr-03 4:39 
GeneralRe: Using the windows shell "Open with" .... Pin
Phil.Benson11-Apr-03 4:46
professionalPhil.Benson11-Apr-03 4:46 
GeneralRe: Using the windows shell "Open with" .... Pin
Hans Ruck11-Apr-03 5:03
Hans Ruck11-Apr-03 5:03 
GeneralRe: Using the windows shell "Open with" .... Pin
Phil.Benson12-Apr-03 2:38
professionalPhil.Benson12-Apr-03 2:38 

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.