📄 tec2000.cpp
字号:
// TEC2000.cpp : Defines the class behaviors for the application.
//
#include "stdafx.h"
#include "TEC2000.h"
#include "MainFrm.h"
#include "TEC2000Doc.h"
#include "TEC2000View.h"
#include "Splash.h"
//#include"SkinMagicLib.h"
#include "SkinMagicLib.h"
#pragma comment(lib, "SkinMagicTrial.lib")
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CTEC2000App
BEGIN_MESSAGE_MAP(CTEC2000App, CWinApp)
//{{AFX_MSG_MAP(CTEC2000App)
ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
//}}AFX_MSG_MAP
// Standard file based document commands
ON_COMMAND(ID_FILE_NEW, CWinApp::OnFileNew)
ON_COMMAND(ID_FILE_OPEN, CWinApp::OnFileOpen)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CTEC2000App construction
CTEC2000App::CTEC2000App()
{
/* R0="0000";
R1="0001";
R2="0002";
R3="0003";
R4="0004";
R5="0005";
R6="0006";
R7="0007";
R8="0008";
R9="0009";
R10="000A";
R11="000B";
R12="000C";
R13="000D";
R14="000E";
R15="000F";
C="0000";
Z="0000";
V="0000";
S="0000";*/
/* for(int i=0;i<16;i++)
R[i]=0;
for(i=0;i<8;i++)
F[i]=0;
*/
help="A (Address)";help+="\r\n";
help+="完成单条指令的汇";help+="\r\n";
help+="编操作,把执行代";help+="\r\n";
help+="码写入内存。";help+="\r\n";
help+="U (Address)";help+="\r\n";
help+="每次从指定的地址";help+="\r\n";
help+="或当前地址寄存器";help+="\r\n";
help+="所示地址反汇编15";help+="\r\n";
help+="条指令。";help+="\r\n";
help+="G (Address)";help+="\r\n";
help+="从指定的地址或当";help+="\r\n";
help+="前地址寄存器所示";help+="\r\n";
help+="地址连续";help+="\r\n";
help+="运行一个用户程序";help+="\r\n";
help+="T (Address)";help+="\r\n";
help+="从指定或PC中地址";help+="\r\n";
help+="开始单条执行命令。";help+="\r\n";
help+="R (寄存器名)";help+="\r\n";
help+="显示所有或指定的";help+="\r\n";
help+="的值并修改指定的";help+="\r\n";
help+="寄存器的值。";help+="\r\n";
help+="D (Address)";help+="\r\n";
help+="从指定地址或当前";help+="\r\n";
help+="寄存器所示地址显";help+="\r\n";
help+="示连续128个存储字";help+="\r\n";
help+="内容。";help+="\r\n";
help+="E Address";help+="\r\n";
help+="从指定地址逐字修";help+="\r\n";
help+="改每个内存单元的";help+="\r\n";
help+="内容。";//help+="\r\n";
// TODO: add construction code here,
// Place all significant initialization in InitInstance
}
/////////////////////////////////////////////////////////////////////////////
// The one and only CTEC2000App object
CTEC2000App theApp;
//WORD memory[65536];
DWORD WINAPI ClientThread(LPVOID lpParam)
{
//POINT* a = (POINT* )lpParam;
//ShowMessage(a->x);// <------------出错
AfxMessageBox("Hello");
return 0;
}
/////////////////////////////////////////////////////////////////////////////
// CTEC2000App initialization
BOOL CTEC2000App::InitInstance()
{
// CG: The following block was added by the Splash Screen component.\ {\ CCommandLineInfo cmdInfo;\ ParseCommandLine(cmdInfo);\\ CSplashWnd::EnableSplashScreen(cmdInfo.m_bShowSplash);\ }
//hello
VERIFY( 1 == InitSkinMagicLib(AfxGetInstanceHandle(), NULL, NULL, NULL));
VERIFY( 1 == LoadSkinFile("xpgrean.smf"));
AfxEnableControlContainer();
// Standard initialization
// If you are not using these features and wish to reduce the size
// of your final executable, you should remove from the following
// the specific initialization routines you do not need.
#ifdef _AFXDLL
Enable3dControls(); // Call this when using MFC in a shared DLL
#else
Enable3dControlsStatic(); // Call this when linking to MFC statically
#endif
AfxInitRichEdit();
// Change the registry key under which our settings are stored.
// TODO: You should modify this string to be something appropriate
// such as the name of your company or organization.
SetRegistryKey(_T("Local AppWizard-Generated Applications"));
LoadStdProfileSettings();// Load standard INI file options (including MRU)
VERIFY( 1 == InitSkinMagicLib( AfxGetInstanceHandle(), "CTEC2000App" ,
NULL,
NULL ) );
VERIFY( 1 == LoadSkinFromResource( AfxGetInstanceHandle(), "IDR_SKIN1", "skin") );
VERIFY( 1 == SetDialogSkin( "Dialog" ) );
// Register the application's document templates. Document templates
// serve as the connection between documents, frame windows and views.
CSplashWnd::ShowSplashScreen(m_pMainWnd);
Sleep(1000);
CSingleDocTemplate* pDocTemplate;
pDocTemplate = new CSingleDocTemplate(
IDR_MAINFRAME,
RUNTIME_CLASS(CTEC2000Doc),
RUNTIME_CLASS(CMainFrame), // main SDI frame window
RUNTIME_CLASS(CTEC2000View));
AddDocTemplate(pDocTemplate);
// Parse command line for standard shell commands, DDE, file open
CCommandLineInfo cmdInfo;
ParseCommandLine(cmdInfo);
// Dispatch commands specified on the command line
if (!ProcessShellCommand(cmdInfo))
return FALSE;
//The one and only window has been initialized, so show and update it.
VERIFY( 1 == SetWindowSkin(m_pMainWnd->GetSafeHwnd(), "MainFrame"));
//hello
// VERIFY( 1 == SetWindowSkin( m_pMainWnd->m_hWnd , "MainFrame" ));
// VERIFY( 1 == SetDialogSkin( "Dialog" ));
m_pMainWnd->ShowWindow(SW_MAXIMIZE);
m_pMainWnd->UpdateWindow();
R=new WORD[16];
F=new int[8];
for(int i=0;i<16;i++)
R[i]=0;
for(i=0;i<8;i++)
F[i]=0;
CTEC2000App *pApp;
pApp=(CTEC2000App *)AfxGetApp();
CMainFrame *p;
p=(CMainFrame *)pApp->GetMainWnd();
CWnd *pRegDlg=p->m_wndViewRegisterDlg.GetDlgItem(IDC_REGISTEREDIT);
CString temp,temp1;
CString r;
r="\r\n";
for(i=0;i<16;i++){
temp.Format("%04x",R[i]);
temp1.Format("%02d",i);
r+="R";r+=temp1;r+="= ";r+=temp;r+="\r\n";
}
temp.Format("%d",pApp->F[0]);
r+="\r\n C = ";r+=temp;
temp.Format("%d",pApp->F[1]);
r+="\r\n Z = ";r+=temp;
temp.Format("%d",pApp->F[2]);
r+="\r\n V = ";r+=temp;
temp.Format("%d",pApp->F[3]);
r+="\r\n S = ";r+=temp;
((CEdit*)pRegDlg)->SetWindowText(r);
CWnd *pHelpDlg=p->m_wndViewHelpDlg.GetDlgItem(IDC_DHELP);
CEdit * ph=(CEdit *)pHelpDlg;
ph->SetWindowText(help);
ShowMins();
memory=new WORD[65536];
for(i=0;i<=65536;i++){memory[i]=0;}
// WORD tempi=0x24ff;
// memory[tempi]=0x8f00;
// CMainFrame *pMainFrame;
// pMainFrame=(CMainFrame *)pApp->GetMainWnd();
// VERIFY(1==SetSingleDialogSkin(pMainFrame->m_wndViewHelpDlg.GetSafeHwnd(),"Dialog"));
// VERIFY(1==SetSingleDialogSkin(pMainFrame->m_wndViewRegisterDlg.GetSafeHwnd(),"Dialog"));
// VERIFY(1==SetSingleDialogSkin(pMainFrame->m_wndCStatusDlg.GetSafeHwnd(),"Dialog"));
return TRUE;
}
/////////////////////////////////////////////////////////////////////////////
// CAboutDlg dialog used for App About
class CAboutDlg : public CDialog
{
public:
CAboutDlg();
// Dialog Data
//{{AFX_DATA(CAboutDlg)
enum { IDD = IDD_ABOUTBOX };
//}}AFX_DATA
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CAboutDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
//{{AFX_MSG(CAboutDlg)
// No message handlers
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
{
//{{AFX_DATA_INIT(CAboutDlg)
//}}AFX_DATA_INIT
}
void CAboutDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CAboutDlg)
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
//{{AFX_MSG_MAP(CAboutDlg)
// No message handlers
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
// App command to run the dialog
void CTEC2000App::OnAppAbout()
{
CAboutDlg aboutDlg;
aboutDlg.DoModal();
}
/////////////////////////////////////////////////////////////////////////////
// CTEC2000App message handlers
BOOL CTEC2000App::PreTranslateMessage(MSG* pMsg)
{
// CG: The following lines were added by the Splash Screen component. if (CSplashWnd::PreTranslateAppMessage(pMsg)) return TRUE; return CWinApp::PreTranslateMessage(pMsg);
}
int CTEC2000App::ExitInstance()
{
// TODO: Add your specialized code here and/or call the base class
// ExitSkinMagicLib();
// delete memory;
return CWinApp::ExitInstance();
}
void CTEC2000App::ShowMins(){
CString mins,minstemp;
char fname[200];
char buffer[100];
// char inscode[20];
// int inssign=1;
GetCurrentDirectory(200,fname);
int len=strlen(fname);
fname[len++]='\\';
fname[len++]='i';
fname[len++]='n';
fname[len++]='s';
fname[len++]='.';
fname[len++]='t';
fname[len++]='x';
fname[len++]='t';
fname[len++]='\0';
ifstream in_filemicro;
in_filemicro.open(fname,ios::in);
while(in_filemicro.eof()==0)
{
in_filemicro.getline(buffer,100,'\n');
mins+=buffer;
mins+="\r\n";
}
CTEC2000App *pApp;
pApp=(CTEC2000App *)AfxGetApp();
CMainFrame *p;
p=(CMainFrame *)pApp->GetMainWnd();
CWnd *pHelpDlg=p->m_wndViewHelpDlg.GetDlgItem(IDC_MINS);
CEdit *ph=(CEdit *)pHelpDlg;
ph->SetWindowText(mins);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -