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

📄 openfile.cpp

📁 这个是我用mfc写的一个pl0的编译器
💻 CPP
字号:
// openfile.cpp : implementation file
//

#include "stdafx.h"
#include "MFCpl0.h"
#include "openfile.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// Copenfile

IMPLEMENT_DYNAMIC(Copenfile, CFileDialog)

Copenfile::Copenfile(BOOL bOpenFileDialog, LPCTSTR lpszDefExt, LPCTSTR lpszFileName,
		DWORD dwFlags, LPCTSTR lpszFilter, CWnd* pParentWnd) :
		CFileDialog(bOpenFileDialog, lpszDefExt, lpszFileName, dwFlags, lpszFilter, pParentWnd)
{

				m_pszFile = new TCHAR[2048]; //set a 2K buffer to hold selected files
	m_pszFile[0] = '\0'; //initialize pointer;
}
Copenfile::~Copenfile()
{
	
	if (m_pszFile != NULL)
		delete [] m_pszFile; //cleanup
}
int Copenfile::DoModal()
{
	ASSERT_VALID(this);
	ASSERT(m_ofn.Flags & OFN_ALLOWMULTISELECT); //make sure multiple file selection is on

	m_ofn.lpstrFile = m_pszFile; //initialize the OPENFILENAME structure
	m_ofn.nMaxFile = 2048;

	return CFileDialog::DoModal();
}

BEGIN_MESSAGE_MAP(Copenfile, CFileDialog)
	//{{AFX_MSG_MAP(Copenfile)
		// NOTE - the ClassWizard will add and remove mapping macros here.
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

⌨️ 快捷键说明

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