//将CString转换成const char *
int stringLength =
::WideCharToMultiByte(CP_UTF8, NULL, video_path, wcslen(video_path), NULL, 0, NULL, NULL);
char* buffer = new char[stringLength + 1];
::WideCharToMultiByte(CP_UTF8, NULL, video_path, wcslen(video_path), buffer, stringLength, NULL, NULL);
buffer[stringLength] = ‘\0‘;
std::string path = buffer;
delete []buffer;
时间: 2024-11-10 02:35:54