Hi All,
I'm trying to write a piece of code to search for all system processes by name
To do this, I'm using :
array<Process^>^matches = Process::GetProcessesByName("notepad");
The problem is, I don't want to use a hard-coded value to search for, I want my function to accept the name of the process as a parameter.
However :
"notepad"; array<Process^>^matches = Process::GetProcessesByName(procName);string procName =
does not work and I get the error:
error C2665: 'System:
iagnostics:
rocess::GetProcessesByName' : none of the 2 overloads could convert all the argument types
Does anyone know what type I should be passing into GetProcessesByName
I've been trying to find some examples on the web, but everything either returns example with the processName hard-coded or examples that are not in C++.
Any help would be greatly appreciated as this has been driving me round in circles....
Thanks!