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

C / C++ / MFC

 
GeneralRe: cfile question Pin
Nish Nishant12-Jun-02 14:26
sitebuilderNish Nishant12-Jun-02 14:26 
GeneralRe: cfile question Pin
Christian Graus12-Jun-02 14:53
protectorChristian Graus12-Jun-02 14:53 
GeneralRe: cfile question Pin
Tim Smith12-Jun-02 15:50
Tim Smith12-Jun-02 15:50 
GeneralRe: cfile question Pin
Christian Graus12-Jun-02 17:39
protectorChristian Graus12-Jun-02 17:39 
GeneralRe: cfile question Pin
Tim Smith12-Jun-02 15:48
Tim Smith12-Jun-02 15:48 
GeneralRe: cfile question Pin
jafrazee12-Jun-02 17:21
jafrazee12-Jun-02 17:21 
GeneralLocal IP address Pin
ed987112-Jun-02 12:13
ed987112-Jun-02 12:13 
GeneralRe: Local IP address Pin
JohnnyG12-Jun-02 13:31
JohnnyG12-Jun-02 13:31 
I got most of my Winsock programming hints from this program though it was designed for Win2K only and uses Winsock 2.0. You do not need Win2K or Winsock 2.0 to do get the IP address and the code below will work. However, here is the link and some of the code from the sample:

http://www.sometips.com/tips/systemmanagement/213.htm

// Here read all IPs of this host
DWORD dwSize = 0 ;
GetIpAddrTable( NULL , &dwSize, FALSE ) ;
PMIB_IPADDRTABLE pIpAddrTable = (PMIB_IPADDRTABLE )new BYTE [ dwSize ] ;
if( pIpAddrTable )
{
if( GetIpAddrTable( (PMIB_IPADDRTABLE)pIpAddrTable, // // buffer for IP table
&dwSize, // size of buffer
FALSE // sort by IP address
) == NO_ERROR )
{
if( pIpAddrTable->dwNumEntries > 2 ) // Second is MS TCP loopback IP ( 127.0.0.1 )
{
m_Multihomed = TRUE ;
char szIP[16];
for( int i = 0 ; i < (int)pIpAddrTable->dwNumEntries ; i++ )
{
in_addr ina ;
ina.S_un.S_addr = pIpAddrTable->table[i].dwAddr ;
char *pIP = inet_ntoa( ina ) ;
strcpy( szIP , pIP ) ;
if( stricmp( szIP , "127.0.0.1" ) )
m_IPArr.Add(pIpAddrTable->table[i].dwAddr) ;
}
}
}
delete [] pIpAddrTable ;
}
GeneralRe: Local IP address Pin
JohnnyG12-Jun-02 13:34
JohnnyG12-Jun-02 13:34 
Generalmap or list? You decide! Pin
moredip12-Jun-02 12:04
moredip12-Jun-02 12:04 
GeneralRe: map or list? You decide! Pin
12-Jun-02 12:13
suss12-Jun-02 12:13 
GeneralRe: map or list? You decide! Pin
moredip12-Jun-02 12:15
moredip12-Jun-02 12:15 
GeneralRe: map or list? You decide! Pin
Tim Smith12-Jun-02 12:25
Tim Smith12-Jun-02 12:25 
GeneralRe: map or list? You decide! Pin
moredip12-Jun-02 12:39
moredip12-Jun-02 12:39 
GeneralRe: map or list? You decide! Pin
Alexandru Savescu13-Jun-02 6:01
Alexandru Savescu13-Jun-02 6:01 
GeneralRe: map or list? You decide! Pin
soptest12-Jun-02 12:32
soptest12-Jun-02 12:32 
QuestionIs there a way to read a given sector on a harddrive? Pin
redeemer12-Jun-02 10:52
redeemer12-Jun-02 10:52 
AnswerRe: Is there a way to read a given sector on a harddrive? Pin
12-Jun-02 11:17
suss12-Jun-02 11:17 
Generaldetermination of file type Pin
12-Jun-02 10:29
suss12-Jun-02 10:29 
GeneralRe: determination of file type Pin
redeemer12-Jun-02 10:48
redeemer12-Jun-02 10:48 
GeneralRe: determination of file type Pin
12-Jun-02 10:53
suss12-Jun-02 10:53 
GeneralRe: determination of file type Pin
redeemer12-Jun-02 11:00
redeemer12-Jun-02 11:00 
GeneralRe: determination of file type Pin
12-Jun-02 11:05
suss12-Jun-02 11:05 
GeneralRe: determination of file type Pin
redeemer12-Jun-02 11:32
redeemer12-Jun-02 11:32 
GeneralRe: determination of file type Pin
Roger Wright12-Jun-02 13:25
professionalRoger Wright12-Jun-02 13:25 

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.