1 2 3 4 5 6 7 8 9 10
|
char* logOpen = (char*)(void*)Marshal::StringToHGlobalAnsi(open);
int num = lstrlenA(logOpen);
int len = MultiByteToWideChar(CP_ACP, 0, logOpen, num, 0, 0);
wchar_t* buf = new wchar_t[len];
MultiByteToWideChar(CP_ACP, 0, logOpen, num, buf, len);
std::wstring r(buf);
delete[] buf;
LPCWSTR result = r.c_str();
ShellExecute(NULL,L"open",result, NULL, NULL, SW_SHOWNORMAL);
|