Click here to Skip to main content
15,921,577 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionRe: any lib to be added to make it work or any changes to be done? Pin
Programm3r23-Mar-07 2:57
Programm3r23-Mar-07 2:57 
AnswerRe: any lib to be added to make it work or any changes to be done? Pin
ShaluMalu23-Mar-07 3:37
ShaluMalu23-Mar-07 3:37 
QuestionRemove focus on a disabled tab item Pin
sireesha_sree23-Mar-07 1:39
sireesha_sree23-Mar-07 1:39 
AnswerRe: Remove focus on a disabled tab item Pin
Phil J Pearson23-Mar-07 7:48
Phil J Pearson23-Mar-07 7:48 
QuestionProblem about ListBox item Pin
Chen-XuNuo23-Mar-07 1:36
Chen-XuNuo23-Mar-07 1:36 
AnswerRe: Problem about ListBox item Pin
Mark Salsbery23-Mar-07 8:05
Mark Salsbery23-Mar-07 8:05 
AnswerRe: Problem about ListBox item Pin
DLChambers23-Mar-07 15:13
DLChambers23-Mar-07 15:13 
QuestionHow to find if a particular system is active or not in a LAN? Pin
Malini Nair23-Mar-07 1:28
Malini Nair23-Mar-07 1:28 
Hello friends, this me back with a question. I ve got a code snippet for finding the list of systems in a LAN.It lists the computer name and the IP address. Now i wanted to know how i can find the status of the system ie. if it is active or not.

here is the piece i used to found the systems:

for ( unsigned int i = 0; i < BufferSize/sizeof(NETRESOURCE); i++, NetResource++ )
if ( NetResource->dwUsage == RESOURCEUSAGE_CONTAINER && NetResource->dwType == RESOURCETYPE_ANY )
{
if ( NetResource->lpRemoteName )
{
CString strFullName = NetResource->lpRemoteName;
if ( 0 == strFullName.Left(2).Compare("\\\\") )
strFullName = strFullName.Right(strFullName.GetLength()-2);
gethostname( szHostName, strlen( szHostName ) );
host = gethostbyname(strFullName);
ptr = (struct in_addr *) host->h_addr_list[0];
int a = ptr->S_un.S_un_b.s_b1; // 211.40.35.76 split up like this.
int b = ptr->S_un.S_un_b.s_b2; // 40
int c = ptr->S_un.S_un_b.s_b3; // 35
int d = ptr->S_un.S_un_b.s_b4; // 76
lpszSystemInfo = tchBuffer;

// Get and display the user name.
GetUserName(lpszSystemInfo, &cchBuff);
strTemp.Format("%s --> %d.%d.%d.%d",strFullName,a,b,c,d);
pList->AddString(strTemp);

}
}
}


this is a downloaded code friends. but still i want to know how.if we can find the IP address, then there must be a way to find its status. Pls do let me know if anyone of you know this.Thanks (in anticipation)

Malini
AnswerRe: How to find if a particular system is active or not in a LAN? Pin
Programm3r23-Mar-07 2:49
Programm3r23-Mar-07 2:49 
QuestionRe: How to find if a particular system is active or not in a LAN? Pin
Mark Salsbery23-Mar-07 8:09
Mark Salsbery23-Mar-07 8:09 
QuestionC++.Net 2005 With Crystal Reports Pin
Pubudu Wijeyaratne23-Mar-07 1:06
Pubudu Wijeyaratne23-Mar-07 1:06 
QuestionHow to include a library file? Pin
Malini Nair23-Mar-07 0:26
Malini Nair23-Mar-07 0:26 
AnswerRe: How to include a library file? Pin
toxcct23-Mar-07 0:29
toxcct23-Mar-07 0:29 
AnswerRe: How to include a library file? Pin
Nibu babu thomas23-Mar-07 1:17
Nibu babu thomas23-Mar-07 1:17 
GeneralRe: How to include a library file? Pin
_808623-Mar-07 1:51
_808623-Mar-07 1:51 
GeneralRe: How to include a library file? Pin
Nibu babu thomas23-Mar-07 2:15
Nibu babu thomas23-Mar-07 2:15 
GeneralRe: How to include a library file? Pin
_808623-Mar-07 4:56
_808623-Mar-07 4:56 
GeneralRe: How to include a library file? Pin
Nibu babu thomas25-Mar-07 17:13
Nibu babu thomas25-Mar-07 17:13 
QuestionScrolling Text problem Pin
vinhcyim23-Mar-07 0:13
vinhcyim23-Mar-07 0:13 
Answerposting guidelines Pin
toxcct23-Mar-07 0:16
toxcct23-Mar-07 0:16 
AnswerRe: Scrolling Text problem Pin
Mark Salsbery23-Mar-07 8:21
Mark Salsbery23-Mar-07 8:21 
QuestionSDI/ View Pin
_808623-Mar-07 0:10
_808623-Mar-07 0:10 
AnswerRe: SDI/ View Pin
RChin23-Mar-07 2:01
RChin23-Mar-07 2:01 
GeneralRe: SDI/ View Pin
_808623-Mar-07 0:52
_808623-Mar-07 0:52 
GeneralRe: SDI/ View Pin
_808623-Mar-07 2:11
_808623-Mar-07 2:11 

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.