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

📄 prop2.cpp

📁 基于omnet++开发的Mf框架下的802.11协议仿真。
💻 CPP
字号:
// Prop2.cpp : implementation file
//

#include "stdafx.h"
#include "table2.h"
#include "Prop2.h"

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

#define DATA 0
#define EXE 1

/////////////////////////////////////////////////////////////////////////////
// CProp2 property page

IMPLEMENT_DYNCREATE(CProp2, CPropertyPage)

CProp2::CProp2() : CPropertyPage(CProp2::IDD)
{
	m_dataorexe=-1;
	//{{AFX_DATA_INIT(CProp2)
	m_path = _T("");
	m_dataorexe = -1;
	//}}AFX_DATA_INIT
}

CProp2::~CProp2()
{
}

void CProp2::DoDataExchange(CDataExchange* pDX)
{
	CPropertyPage::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CProp2)
	DDX_Text(pDX, IDC_EDIT1, m_path);
	DDX_Radio(pDX, IDC_RADIO1, m_dataorexe);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CProp2, CPropertyPage)
	//{{AFX_MSG_MAP(CProp2)
	ON_BN_CLICKED(IDC_BUTTON5, OnButton5)
	ON_BN_CLICKED(IDC_BUTTON1, OnButton1)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CProp2 message handlers

void CProp2::OnButton5() 
{
	// TODO: Add your control notification handler code here
	UpdateData();
	if(m_dataorexe==-1)
	{
		MessageBox("Please select the style!");
	}
	else if(m_dataorexe==DATA)
	{
		ShellExecute(NULL,"open","c:\\windows\\system32\\cmd.exe ",
			"/c opp_nmakemake -f",m_path,SW_SHOWNORMAL);
		ShellExecute(NULL,"open","c:\\windows\\system32\\cmd.exe ",
			"/c nmake -f Makefile.vc",m_path,SW_SHOWNORMAL);
	}
	else if(m_dataorexe==EXE)
	{
		ShellExecute(NULL,"open","c:\\windows\\system32\\cmd.exe ",
			"/c opp_nmakemake -f",m_path,SW_SHOWNORMAL);
		ShellExecute(NULL,"open","c:\\windows\\system32\\cmd.exe ",
			"/c nmake -f Makefile.vc",m_path,SW_SHOWNORMAL);
	}
}

void CProp2::OnButton1() 
{
	// TODO: Add your control notification handler code here
	BROWSEINFO bi;
	char path[MAX_PATH];
	LPITEMIDLIST pbi;
	ZeroMemory(&bi,sizeof(BROWSEINFO));
	bi.pszDisplayName = path;
	pbi = SHBrowseForFolder(&bi);
	SHGetPathFromIDList(pbi,path);
	m_path = path;
	UpdateData(false);

}

⌨️ 快捷键说明

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