string - how to use a variable in parameters -
i need know how use variable in parameters process initalized string process in class parameters.
process::getprocessesbyname("") which gives me error when replace string variable
process::getprocessesbyname(process) the error is: no instance of overloaded function "system::diagnostics::process::getprocessbyname" matches argument list argument types (std::string)
i think getprocessesbyname may take parameter lpstr or char const *, not std::string,
try use
process::getprocessesbyname(process.c_str()); or if process defined std::string process;,
string^ process_name = gcnew string(process.c_str()); process::getprocessesbyname(process_name);
Comments
Post a Comment