程序片段----弹出文件夹

来源:互联网 发布:linux下c 多线程 编辑:程序博客网 时间:2024/06/05 02:38
#include <Windows.h>...std::string output_path("../Project_test/numberData");ShellExecute(nullptr,(LPCWSTR)L"open", nullptr, nullptr, \stringToLPCWSTR(output_path), SW_SHOWNORMAL);...


stringToLPCWSTR的定义:

http://blog.csdn.net/jfkidear/article/details/26363711

{size_t origsize = orig.length() + 1;const size_t newsize = 100;size_t convertedChars = 0;wchar_t *wcstring = (wchar_t *)malloc(sizeof(wchar_t)*(orig.length() - 1));mbstowcs_s(&convertedChars, wcstring, origsize, orig.c_str(), _TRUNCATE);return wcstring;}


原创粉丝点击