//**************************************************************************************
void CBCGPWindowsManagerDlg::OnSave() 
{
	int nItems = m_wndList.GetCount();
	if (nItems > 0)
	{
		for (int i = 0; i < nItems; i++)
		{
			if (m_wndList.GetSel (i) > 0)
			{
				HWND hWnd=(HWND) m_wndList.GetItemData (i);

				if (m_lstSaveDisabled.Find (hWnd) == NULL)
				{
					CWnd* pWnd = CWnd::FromHandle (hWnd);
					CFrameWnd* pFrame = DYNAMIC_DOWNCAST (CFrameWnd, pWnd);

					if (pFrame != NULL)
					{
						CDocument *pDoc = pFrame->GetActiveDocument();
						if (pDoc != NULL)
						{
							ASSERT_VALID (pDoc);
							pDoc->DoFileSave();
						}
					}
				}
			}
		}
	}

	FillWindowList ();
	SelActive ();
	UpdateButtons ();
}
Example #2
0
void CMainFrame::OnCmdBuild()
{
	CDocument *pDoc = GetActiveFrame()->GetActiveDocument();
	pDoc->DoFileSave();

	CString strFolder = theApp.CombinePath( theApp.GetPath(), theApp.m_strSDKOutput );
	CString strApp = theApp.CombinePath( theApp.GetPath(), theApp.m_strCompilerApp );
	SetEnvironmentVariable( _T("NEWPAS"), '"' + strApp + '"' );

	CString strArgs;
	// using an environ. var. because cmd /C doesn't support more than 1 quoted path
	strArgs.Format( _T("/C %%NEWPAS%% \"%s\" outvm || pause"), (LPCTSTR)pDoc->GetPathName() );

	::ShellExecute( 0, _T("open"), _T("cmd"), strArgs, strFolder, SW_SHOW );
}
Example #3
0
void CMainFrame::OnCmdRun()
{
	CDocument *pDoc = GetActiveFrame()->GetActiveDocument();
	pDoc->DoFileSave();

	CString strApp = theApp.CombinePath( theApp.GetPath(), theApp.m_strCompilerApp );
	SetEnvironmentVariable( _T("NEWPAS"), '"' + strApp + '"' );

	CString strArgs;
	// using an environ. var. because cmd /C doesn't support more than 1 quoted path
	strArgs.Format( _T("/C %%NEWPAS%% \"%s\" execvm & pause"), (LPCTSTR)pDoc->GetPathName() );

	TCHAR szFolder[MAX_PATH];
	_tcscpy_s( szFolder, MAX_PATH, pDoc->GetPathName() );
	PathRemoveFileSpec( szFolder );

	::ShellExecute( 0, _T("open"), _T("cmd"), strArgs, szFolder, SW_SHOW );
}