Commit cf293bea authored by devill.tamachan's avatar devill.tamachan

[バグ修正] 引数なしで実行するとファイルが見つかりませんダイアログがでる/またはBz.exe本体が開かれるバグ

CommandLineToArgvWの謎仕様。空文字列渡すと.exe本体のパスが返ってくる
parent 3e99bb64
......@@ -62,29 +62,32 @@ int Run(LPTSTR lpstrCmdLine = NULL, int nCmdShow = SW_SHOWDEFAULT)
CBZCoreData *pCoreData = CBZCoreData::GetInstance();
int argc = 0;
LPWSTR *argv = CommandLineToArgvW(lpstrCmdLine, &argc);
if(argc>=2)
if(lpstrCmdLine!=NULL && lpstrCmdLine[0]!=NULL)
{
CMainFrame *pMainFrame = pCoreData->GetMainFrame();
if(pMainFrame!=NULL)
LPWSTR *argv = CommandLineToArgvW(lpstrCmdLine, &argc);
if(argc>=2)
{
pMainFrame->_OnViewSplit(ID_VIEW_SPLIT_H);
CMainFrame *pMainFrame = pCoreData->GetMainFrame();
if(pMainFrame!=NULL)
{
pMainFrame->_OnViewSplit(ID_VIEW_SPLIT_H);
}
}
for(int i=0;i<argc;i++)
{
if(i>=2)break;
CBZView *pBZView = pCoreData->GetBZView(i);
if(pBZView==NULL)break;
CBZDoc2 *pDoc = pBZView->m_pDoc;
if(pDoc==NULL)break;
CString filename = argv[i];
LPTSTR pFilename = filename.GetBuffer();
PathUnquoteSpaces(pFilename);
filename.ReleaseBuffer();
pDoc->OnFileOpen(filename, wndMain.m_hWnd);
pBZView->Update();
}
}
for(int i=0;i<argc;i++)
{
if(i>=2)break;
CBZView *pBZView = pCoreData->GetBZView(i);
if(pBZView==NULL)break;
CBZDoc2 *pDoc = pBZView->m_pDoc;
if(pDoc==NULL)break;
CString filename = argv[i];
LPTSTR pFilename = filename.GetBuffer();
PathUnquoteSpaces(pFilename);
filename.ReleaseBuffer();
pDoc->OnFileOpen(filename, wndMain.m_hWnd);
pBZView->Update();
}
wndMain.UpdateFrameTitle();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment