try as following: String ^str="9.99"; System::Single d=Single::Parse(str);
Z
zhushaolin2005
@zhushaolin2005
Posts
-
Simple question on String to double -
CopyFile method and String conversionscode as following, String^ source = "C:\\Temp\\Firefox.pcv"; String^ dest = "E:\\Test\\Firefox.pcv"; System::IO::File::Copy(source,dest); using the clr base as much as better,it's simple and clear. the system::io::file is a static class .
-
Checking for presence of System::IO::Ports::SerialPort...sp=nullptr; if (sp==nullptr) { dosometing; } alse,you can do like this ..sp; if (sp==nullptr) { dosometing; } in the c++/cli,the default object is equal to "nullptr".
-
Managed forms application with 'autosave' wantedtry as following public: Threading::Thread ^thd = gcnew Thread(new ThreadStart(autoSave)); private: System::Void LoadFiles(void) { thd->Start(); } private: System::Void autoSave(void) { Threading::Thread.Sleep(5000); }