MFC如何在调用的程序结束后继续
本人初学,希望得到帮助:voidCMFCApplication1Dlg::OnBnClickedButton1(){CStringLuaName;CStringPackN...
本人初学,希望得到帮助:
void CMFCApplication1Dlg::OnBnClickedButton1(){ CString LuaName; CString PackName; CString LuaPath; CString text; HTREEITEM lua = m_tree.GetSelectedItem(); HTREEITEM parent = m_tree.GetParentItem(lua); if (parent != NULL) { LuaName = m_tree.GetItemText(lua); PackName = m_tree.GetItemText(parent); LuaPath = PackName + _T("\\") + LuaName; SHELLEXECUTEINFO ShExecInfo = { 0 }; ShExecInfo.cbSize = sizeof(SHELLEXECUTEINFO); ShExecInfo.fMask = SEE_MASK_NOCLOSEPROCESS; ShExecInfo.hwnd = NULL; ShExecInfo.lpVerb = NULL; ShExecInfo.lpFile = _T(".\\lua\\lua.exe" ); ShExecInfo.lpParameters = ".\\lua\\decompile_levels.lua .\\data\\levels\\" + LuaPath; ShExecInfo.lpDirectory = NULL; ShExecInfo.nShow = SW_SHOW; ShExecInfo.hInstApp = NULL; ShellExecuteEx(&ShExecInfo); WaitForSingleObject(ShExecInfo.hProcess, INFINITE); CFile file; file.Open(_T(".\\data\\levels\\" + )LuaPath + _T(".dec"), CFile::modeReadWrite); file.Read(text.GetBuffer(file.GetLength()), file.GetLength()); file.Close(); GetDlgItem(IDC_EDIT1)->SetWindowText(text); } }这样以后lpParameters参数传进去会变成乱码,似乎是+LuaPath的事,去掉将钱部分改成具体的lua文件就没事了,该怎么办啊,感激不尽 展开
void CMFCApplication1Dlg::OnBnClickedButton1(){ CString LuaName; CString PackName; CString LuaPath; CString text; HTREEITEM lua = m_tree.GetSelectedItem(); HTREEITEM parent = m_tree.GetParentItem(lua); if (parent != NULL) { LuaName = m_tree.GetItemText(lua); PackName = m_tree.GetItemText(parent); LuaPath = PackName + _T("\\") + LuaName; SHELLEXECUTEINFO ShExecInfo = { 0 }; ShExecInfo.cbSize = sizeof(SHELLEXECUTEINFO); ShExecInfo.fMask = SEE_MASK_NOCLOSEPROCESS; ShExecInfo.hwnd = NULL; ShExecInfo.lpVerb = NULL; ShExecInfo.lpFile = _T(".\\lua\\lua.exe" ); ShExecInfo.lpParameters = ".\\lua\\decompile_levels.lua .\\data\\levels\\" + LuaPath; ShExecInfo.lpDirectory = NULL; ShExecInfo.nShow = SW_SHOW; ShExecInfo.hInstApp = NULL; ShellExecuteEx(&ShExecInfo); WaitForSingleObject(ShExecInfo.hProcess, INFINITE); CFile file; file.Open(_T(".\\data\\levels\\" + )LuaPath + _T(".dec"), CFile::modeReadWrite); file.Read(text.GetBuffer(file.GetLength()), file.GetLength()); file.Close(); GetDlgItem(IDC_EDIT1)->SetWindowText(text); } }这样以后lpParameters参数传进去会变成乱码,似乎是+LuaPath的事,去掉将钱部分改成具体的lua文件就没事了,该怎么办啊,感激不尽 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询