⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tmguidlg.cpp

📁 wince host 和 target PCI驱动程序
💻 CPP
📖 第 1 页 / 共 2 页
字号:
{
	// TODO: Add your control notification handler code here
//	char currentDir[200];

	static CString	sFileName;
	char	*pFileName;
	if(sFileName.IsEmpty())
		pFileName = NULL;
	else
		pFileName = (char*)(const char*)sFileName;

//	GetCurrentDirectory(200,currentDir);
	CFileDialog dlg(
		TRUE,										// Open File Dialog
		NULL,									// Default extension
		pFileName,								// No default filename
		OFN_HIDEREADONLY,		// OPENFILENAME flags
		"All Files|*.*||");	// Filter strings
	
	dlg.m_ofn.Flags |= OFN_NOCHANGEDIR;
	if (dlg.DoModal() == IDOK)
	{
		SetDlgItemText(IDC_EDIT5,dlg.GetPathName());
		sFileName = dlg.GetPathName();
	}
//	SetCurrentDirectory(currentDir);		// add ??
}

void CTmgmonDlg::OnButton2() 
{
	// TODO: Add your control notification handler code here

	UpdateData(TRUE);
	if(!m_taskFile.IsEmpty())
	{
	ctc_loadfile(m_taskFile.GetBuffer(100),m_taskArguments.GetBuffer(100));
	m_taskFile.ReleaseBuffer();
	m_taskArguments.ReleaseBuffer();
	}
}

void CTmgmonDlg::OnButton3() 
{
	// TODO: Add your control notification handler code here
	UpdateData(TRUE);
	ctc_go(m_taskFile.GetBuffer(100),m_taskArguments.GetBuffer(100));
	m_taskFile.ReleaseBuffer();
	m_taskArguments.ReleaseBuffer();
}

void CTmgmonDlg::OnButton4() 
{
	// TODO: Add your control notification handler code here
	ctc_stop();
	
}

BOOL CAboutDlg::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	// TODO: Add extra initialization here
	SetDlgItemText(IDC_STATIC2,verstr);

	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

void CTmgmonDlg::OnButton5() 
{
	// TODO: Add your control notification handler code here
	DWORD phyAdr;
	extern int globalmemtype;

	UpdateData(TRUE);
	sscanf(m_phymem.GetBuffer(100),"%x",&phyAdr);
	m_phymem.ReleaseBuffer();

	if(ctc_mem(m_hWnd,phyAdr,m_memoption,1))
		if(m_memoption != 2 && globalmemtype==2)		//MMIO
		{
			m_memoption=2;
			UpdateData(FALSE);
		}
	
}

void CTmgmonDlg::OnRadio1() 
{
	// TODO: Add your control notification handler code here
	UpdateData(TRUE);
	ctc_mem(m_hWnd,0,m_memoption,0);
}

void CTmgmonDlg::OnRadio2() 
{
	// TODO: Add your control notification handler code here
	UpdateData(TRUE);
	ctc_mem(m_hWnd,0,m_memoption,0);

}

void CTmgmonDlg::OnRadio3() 
{
	// TODO: Add your control notification handler code here
	int x;
	UpdateData(TRUE);
	x=m_memoption;
	ctc_mem(m_hWnd,0,m_memoption,0);
	
}

void CTmgmonDlg::OnCheck7() 
{
	// TODO: Add your control notification handler code here
	UpdateData(TRUE);
	if(m_debugsdram)
		ctc_debug("debugon sdram .");
	else
		ctc_debug("debugoff sdram .");

}

void CTmgmonDlg::OnCheck8() 
{
	// TODO: Add your control notification handler code here
	UpdateData(TRUE);
	if(m_debugmono)
		ctc_debug("debugon mono .");
	else
		ctc_debug("debugoff mono .");
	
}

void CTmgmonDlg::OnCheck9() 
{
	// TODO: Add your control notification handler code here
	UpdateData(TRUE);
	if(m_debugpcmem)
		ctc_debug("debugon pcmem .");
	else
		ctc_debug("debugoff pcmem .");
	
}

void CTmgmonDlg::OnCheck4() 
{
	// TODO: Add your control notification handler code here
	CString str;
	UpdateData(TRUE);
	if(m_stdin)
	{
		if(!m_stdinfile.IsEmpty())
		{
			str="SI " + m_stdinfile + ".";
			ctc_redirect(str.GetBuffer(100));
			str.ReleaseBuffer();
		}
	}
	else
		ctc_redirect("EI");
	
}

void CTmgmonDlg::OnCheck5() 
{
	// TODO: Add your control notification handler code here
	CString str;
	UpdateData(TRUE);
	if(m_stdout)
	{
		if(!m_stdoutfile.IsEmpty())
		{
			str="SO " + m_stdoutfile + ".";
			ctc_redirect(str.GetBuffer(100));
			str.ReleaseBuffer();
		}
	}
	else
		ctc_redirect("EO");
	
}

void CTmgmonDlg::OnCheck6() 
{
	// TODO: Add your control notification handler code here
	CString str;
	UpdateData(TRUE);
	if(m_stderr)
	{
		if(!m_stderrfile.IsEmpty())
		{
			str="SE " + m_stderrfile + ".";
			ctc_redirect(str.GetBuffer(100));
			str.ReleaseBuffer();
		}
	}
	else
		ctc_redirect("ER");
	
}

void CTmgmonDlg::OnButton9() 
{
	// TODO: Add your control notification handler code here
	CEdit* pEdit=(CEdit* )GetDlgItem(IDC_EDIT6);
	HWND	hWnd_Edit = pEdit->m_hWnd;
	int		iTopLine;
	// remove 1/7/98
//	static CString sLastFileName;			// to keep the last file name
//	CString cstr;

	UpdateData(TRUE);
	if(m_tracefile.IsEmpty() || !m_trace)
	{
		// get the top line in the edit box
		iTopLine = pEdit->GetFirstVisibleLine();

/*	remove 1/7/98
		// check what is the entry in the ini file
		if (sLastFileName == g_sFileName)
			cstr = g_sFileName;
		else
		{
			cstr = sLastFileName;
			sLastFileName = g_sFileName;
		}

		if(!cstr.IsEmpty())
		{
			if(iTopLine > 0)
				// save the top line to ini file
				AfxGetApp()->WriteProfileInt("TraceP_TopLine",
										(char*)(const char*)cstr,
										iTopLine);
			else
				// remove the entry if iTopLine == 0.
				AfxGetApp()->WriteProfileString("TraceP_TopLine",
										(char*)(const char*)cstr,
										NULL);
			// flush the buffer
			WritePrivateProfileString(NULL,NULL,NULL,"tmgmon.ini");
		}
*/
		ctc_trace(pEdit,"tracep .");

/*	remove 1/7/98
		// get the top line from the ini file
		iTopLine = (int) AfxGetApp()->GetProfileInt("TraceP_TopLine",
									(char*)(const char*)g_sFileName,
									0);
*/
		// scroll the edit box to the iTopLine
		if (iTopLine > 0 && iTopLine < pEdit->GetLineCount())
			pEdit->LineScroll(iTopLine);
	}
	else
	{
		CString str;
		str="tracep " + m_tracefile + " .";
		ctc_trace(pEdit,str.GetBuffer(100));
		str.ReleaseBuffer();
	}
	
}



void CTmgmonDlg::OnErrspaceEdit6() 
{
	// TODO: Add your control notification handler code here
	AfxMessageBox("Cannot Display Complete Trace Buffer\n"
		"Redirect Output to Trace File");
	tracefull=1;
}

void CTmgmonDlg::OnButton10() 
{
	// TODO: Add your control notification handler code here
	CEdit* pEdit=(CEdit* )GetDlgItem(IDC_EDIT6);
	UpdateData(TRUE);
	if(m_tracefile.IsEmpty() || !m_trace)
		ctc_trace(pEdit,"tracev .");
	else
	{
		CString str;
		str="tracev " + m_tracefile + " .";
		ctc_trace(pEdit,str.GetBuffer(100));
		str.ReleaseBuffer();
	}
	
}

void CTmgmonDlg::OnButton11() 
{
	// TODO: Add your control notification handler code here
//	char currentDir[200];

	static CString	sFileName;
	char	*pFileName;
	if(sFileName.IsEmpty())
		pFileName = NULL;
	else
		pFileName = (char*)(const char*)sFileName;

//	GetCurrentDirectory(200,currentDir);
		CFileDialog dlg(
		TRUE,										// Open File Dialog
		NULL,									// Default extension
		pFileName,								// No default filename
		OFN_HIDEREADONLY,		// OPENFILENAME flags
		"All Files|*.*||");	// Filter strings
	
	dlg.m_ofn.Flags |= OFN_NOCHANGEDIR;
	if (dlg.DoModal() == IDOK)
	{
		SetDlgItemText(IDC_EDIT8,dlg.GetPathName());
		sFileName = dlg.GetPathName();
	}
//	SetCurrentDirectory(currentDir);

}


void CTmgmonDlg::OnMaxtextEdit6() 
{
	// TODO: Add your control notification handler code here
	AfxMessageBox("Cannot Display Complete Trace Buffer\n"
		"Redirect Output to Trace File");
	tracefull=1;
}



void CTmgmonDlg::OnDeltaposSpinnum(NMHDR* pNMHDR, LRESULT* pResult) 
{
	NM_UPDOWN* pNMUpDown = (NM_UPDOWN*)pNMHDR;
	// TODO: Add your control notification handler code here
	UINT no;
	extern DWORD dwDSPNumber;

	no=pNMUpDown->iPos+pNMUpDown->iDelta;
	if(no >= 0 && no < dwDSPCount )
	{
		dwDSPNumber=no;
		ctc_newcard();
		if(!ctc_main(this,verstr))		// Not successful
			PostQuitMessage(0);
	}
	
	*pResult = 0;
}

void CTmgmonDlg::OnClose() 
{
	// TODO: Add your message handler code here and/or call default
	ctc_exit();
	CDialog::OnClose();
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -