TCHAR to String^ and String^ to TCHAR
Posted on 2009-05-14
I am using VS2008 and windows forms application. I have to define a global string but I get an error if i do that (error: global or static variable may not have managed type 'System::String ^'). It is allowing me to declare a global TCHAR, but I can't seem to get TCHAR converted to String^ or the other way around.
error C2440: '=' : cannot convert from 'TCHAR' to 'System::String ^'
error C2440: '=' : cannot convert from 'System::String' to 'System::String ^'