Click here to Skip to main content
15,891,828 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Using STL with Visual C++ Pin
M_A1-Sep-04 21:32
M_A1-Sep-04 21:32 
QuestionCan I declare a path with a single "\" Pin
nigma_x1-Sep-04 4:07
nigma_x1-Sep-04 4:07 
AnswerRe: Can I declare a path with a single "\" Pin
David Crow1-Sep-04 4:12
David Crow1-Sep-04 4:12 
GeneralRe: Can I declare a path with a single "\" Pin
Mika Larramo2-Sep-04 12:31
Mika Larramo2-Sep-04 12:31 
AnswerRe: Can I declare a path with a single "\" Pin
V.1-Sep-04 4:23
professionalV.1-Sep-04 4:23 
QuestionHow to call a variable in system() Pin
MrJake1-Sep-04 3:31
MrJake1-Sep-04 3:31 
AnswerRe: How to call a variable in system() Pin
David Crow1-Sep-04 4:16
David Crow1-Sep-04 4:16 
AnswerRe: How to call a variable in system() Pin
Lim Bio Liong1-Sep-04 7:31
Lim Bio Liong1-Sep-04 7:31 
Hello MrJake,

I agree with David Crow that using TCP/IP APIs would be far more superior to the technique that you are presently using.

However, to achieve your approach, I suggest declaring a string variable and then use it to build up your command line (for the system() function). I would also suggest redirecting the output of "ping.exe" to some external file that you can open up and read in order to process and analyse the output of ping.exe.

The following is an example :

char command_line[100];

sprintf (command_line, "ping -c 2 %s > ping.txt", ip);
system(command_line);

...
...
...

Give it a try.

Regards,
Bio.



QuestionHow to change Grid lines Color in List Control Pin
Muhammad Azam1-Sep-04 3:03
Muhammad Azam1-Sep-04 3:03 
GeneralList Controls Row Height Pin
Muhammad Azam1-Sep-04 3:00
Muhammad Azam1-Sep-04 3:00 
GeneralCreating user accounts in XP Pin
Phil J Pearson1-Sep-04 2:54
Phil J Pearson1-Sep-04 2:54 
GeneralRe: Creating user accounts in XP Pin
Antony M Kancidrowski1-Sep-04 3:15
Antony M Kancidrowski1-Sep-04 3:15 
GeneralRe: Creating user accounts in XP Pin
Phil J Pearson1-Sep-04 3:43
Phil J Pearson1-Sep-04 3:43 
GeneralRe: Creating user accounts in XP Pin
Phil J Pearson1-Sep-04 5:05
Phil J Pearson1-Sep-04 5:05 
GeneralRe: Creating user accounts in XP Pin
darkbyte1-Sep-04 8:31
darkbyte1-Sep-04 8:31 
GeneralAssert message Pin
Anonymous1-Sep-04 2:54
Anonymous1-Sep-04 2:54 
Generalmemory problem with bitmaps Pin
eNez1-Sep-04 1:50
eNez1-Sep-04 1:50 
GeneralRe: memory problem with bitmaps Pin
David Crow1-Sep-04 4:26
David Crow1-Sep-04 4:26 
GeneralRe: memory problem with bitmaps Pin
eNez1-Sep-04 4:37
eNez1-Sep-04 4:37 
GeneralRe: memory problem with bitmaps Pin
David Crow1-Sep-04 4:43
David Crow1-Sep-04 4:43 
GeneralRe: memory problem with bitmaps Pin
eNez1-Sep-04 4:56
eNez1-Sep-04 4:56 
QuestionHow to close open ComboBox ? Pin
Anonymous1-Sep-04 1:49
Anonymous1-Sep-04 1:49 
AnswerRe: How to close open ComboBox ? Pin
Ivan Cachicatari2-Sep-04 19:22
Ivan Cachicatari2-Sep-04 19:22 
GeneralBit Inversion Pin
sweep1231-Sep-04 1:48
sweep1231-Sep-04 1:48 
GeneralRe: Bit Inversion Pin
RChin1-Sep-04 2:08
RChin1-Sep-04 2:08 

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.