Click here to Skip to main content
15,896,456 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralProper organization of .cpp and .h files. Pin
blackmesa5-Jan-04 11:59
blackmesa5-Jan-04 11:59 
GeneralRe: Proper organization of .cpp and .h files. Pin
Jörgen Sigvardsson5-Jan-04 12:51
Jörgen Sigvardsson5-Jan-04 12:51 
Generalproblem with gethostbyaddr Pin
Chernobog15-Jan-04 11:47
Chernobog15-Jan-04 11:47 
GeneralRe: problem with gethostbyaddr Pin
Jörgen Sigvardsson6-Jan-04 0:15
Jörgen Sigvardsson6-Jan-04 0:15 
GeneralRe: problem with gethostbyaddr Pin
David Crow6-Jan-04 5:07
David Crow6-Jan-04 5:07 
GeneralRe: problem with gethostbyaddr Pin
Chernobog17-Jan-04 12:22
Chernobog17-Jan-04 12:22 
GeneralNewbie C++ question Pin
Anonymous5-Jan-04 11:26
Anonymous5-Jan-04 11:26 
GeneralRe: Newbie C++ question Pin
Ian Darling5-Jan-04 11:43
Ian Darling5-Jan-04 11:43 
You need to construct the string correctly - what you're doing is trying to call system with a string literal - which doesn't take what you set comp_name to into account (here's a question for you, what would your "code" do if you had a variable called WINNT? Smile | :) )

What you need to do is construct a std::string with the relevant computer name:

string command_to_do;
command_to_do = "del \\";
command_to_do += comp_name;
command_to_do += "\c$\WINNT\MS\SMS\CORE\BIN\SlowNet.exe"

system(command_to_do.c_str());


(Untested code, so your milage may vary)

--
Ian Darling
"The moral of the story is that with a contrived example, you can prove anything." - Joel Spolsky
GeneralRe: Newbie C++ question Pin
Jörgen Sigvardsson5-Jan-04 12:53
Jörgen Sigvardsson5-Jan-04 12:53 
GeneralRe: Newbie C++ question Pin
David Crow6-Jan-04 5:16
David Crow6-Jan-04 5:16 
GeneralNewbie C++ question Pin
Anonymous5-Jan-04 11:25
Anonymous5-Jan-04 11:25 
QuestionHow to monitor file operations Pin
shaomin5-Jan-04 10:37
shaomin5-Jan-04 10:37 
AnswerRe: How to monitor file operations Pin
Ravi Bhavnani5-Jan-04 11:48
professionalRavi Bhavnani5-Jan-04 11:48 
GeneralRe: How to monitor file operations Pin
shaomin8-Jan-04 12:55
shaomin8-Jan-04 12:55 
GeneralCalling UpdateData(FALSE) will screw my RadioButton-group selection Pin
andreir235-Jan-04 9:33
andreir235-Jan-04 9:33 
GeneralRe: Calling UpdateData(FALSE) will screw my RadioButton-group selection Pin
abc8765-Jan-04 10:05
abc8765-Jan-04 10:05 
GeneralRe: Calling UpdateData(FALSE) will screw my RadioButton-group selection Pin
David Crow5-Jan-04 10:13
David Crow5-Jan-04 10:13 
GeneralRe: Calling UpdateData(FALSE) will screw my RadioButton-group selection Pin
andreir235-Jan-04 11:17
andreir235-Jan-04 11:17 
GeneralRe: Calling UpdateData(FALSE) will screw my RadioButton-group selection Pin
abc8765-Jan-04 20:20
abc8765-Jan-04 20:20 
GeneralRe: Calling UpdateData(FALSE) will screw my RadioButton-group selection Pin
Nick Hodapp5-Jan-04 10:27
sitebuilderNick Hodapp5-Jan-04 10:27 
Generalsprintf formatting with conditional statement Pin
shultas5-Jan-04 8:45
shultas5-Jan-04 8:45 
GeneralRe: sprintf formatting with conditional statement Pin
Tyler Kellen5-Jan-04 8:49
Tyler Kellen5-Jan-04 8:49 
GeneralRe: sprintf formatting with conditional statement Pin
abc8765-Jan-04 8:57
abc8765-Jan-04 8:57 
GeneralRe: sprintf formatting with conditional statement Pin
Prakash Nadar5-Jan-04 16:08
Prakash Nadar5-Jan-04 16:08 
GeneralRe: sprintf formatting with conditional statement Pin
abc8765-Jan-04 19:47
abc8765-Jan-04 19:47 

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.