0

I get Idmachine with GetVolumeInformation command. I want changed idmachine (DWORD) to string then show in TEdit(C++ builder) but not. Please help me!

GetVolumeInformation(L"C:\\",NULL,NULL,&dwVolSerial,NULL,NULL,NULL,NULL);
std::wstring wstr = std::to_wstring(idmachine);
std::string str = std::string(wstr.begin(), wstr.end());
ShowMessage(str);

Error Vcl.Dialogs.hpp(1430): candidate function not viable: no known conversion from 'std::string' (aka 'basic_string, allocator >') to 'const System::UnicodeString' for 1st argument

Vô Danh
  • 1
  • 5
  • GetVolumeInformation(L"C:\\",NULL,NULL,&dwVolSerial,NULL,NULL,NULL,NULL); std::wstring wstr = std::to_wstring(dwVolSerial); std::string str = std::string(wstr.begin(), wstr.end()); ShowMessage(str); – Vô Danh Nov 04 '19 at 01:05
  • Hope [this](https://stackoverflow.com/questions/893670/how-do-i-construct-a-stdstring-from-a-dword) helps – GAVD Nov 04 '19 at 01:17

0 Answers0