Click to See Complete Forum and Search --> : from int to System::String^


boever
March 25th, 2009, 01:56 PM
Hi

else if(processes->Length == 1){
Process^ process = (Process^) processes->GetValue(0);
int pId = process->Id;
txtPID->Text = pId->ToString();
}

this is my code .. i want to show ProcessId in txtPID.
But ->ToString() is wrong.


Please help

Skizmo
March 25th, 2009, 01:58 PM
Your code is C#. We are only answering native C++ question. ASk you question here (http://www.codeguru.com/forum/forumdisplay.php?f=11).

boever
March 25th, 2009, 02:16 PM
Your code is C#. We are only answering native C++ question. ASk you question here (http://www.codeguru.com/forum/forumdisplay.php?f=11).

Answer : System::Convert::ToString( myint);

And this code is not c# :s
Visual C++ > windows form application ... if it's not c++ or c# then what is it?

GCDEF
March 25th, 2009, 02:20 PM
Answer : System::Convert::ToString( myint);

And this code is not c# :s
Visual C++ > windows form application ... if it's not c++ or c# then what is it?

Managed C++. Still the wrong forum.

Paul McKenzie
March 25th, 2009, 04:34 PM
Answer : System::Convert::ToString( myint);

And this code is not c# :s
Visual C++ > windows form application ... if it's not c++ or c# then what is it?Get the knowledge of the tools you're using.

Managed C++ (which your code is) is not traditional C++. There is no such syntax in C++ as sticking a caret character onto a variable name, unless you're taking the exclusive-OR of something:

int main()
{
int x, y;
//...
int z = x^y; // take the exclusive or
}

Regards,

Paul McKenzie

cilu
March 26th, 2009, 02:46 AM
[ redirected ]