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

#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;
}


猜你喜欢

转载自blog.csdn.net/u014488388/article/details/78003024