Click here to Skip to main content
15,922,696 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
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 
GeneralRe: How can I get the IP of my server? Pin
Salvador Dali11-Apr-03 22:42
Salvador Dali11-Apr-03 22:42 
Thanks Peter,

I have been trying to get the ip from the hostent structure all
along, but I didn't use the DWORD cast you did. I assumed it
was already in the form of a string.
But the code that did it in the end is this:
<br />
char strHostname[128];<br />
gethostname(strHostname, sizeof(strHostname));<br />
hostent *pHostent = gethostbyname(strHostname);<br />
ULONG ip = *(ULONG *)pHostent->h_addr;<br />
in_addr ipaddr;<br />
ipaddr.S_un.S_addr = ip;<br />
m_strServerIP = inet_ntoa(ipaddr);<br />

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 
GeneralRe: Using the windows shell "Open with" .... Pin
Hans Ruck12-Apr-03 7:18
Hans Ruck12-Apr-03 7:18 

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.