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

📄 searchpath.cpp

📁 用于误码仪测试
💻 CPP
字号:
// SearchPath.cpp: implementation of the CSearchPath class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "Test4G.h"
#include "SearchPath.h"
#include "io.h"

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

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

CSearchPath::CSearchPath()
{
}

CSearchPath::~CSearchPath()
{

}

CString  CSearchPath::GetFilePath(CString FilePathName)
{
	CString tmpStr;
	char drive[_MAX_DRIVE],dir[_MAX_DIR],fname[_MAX_FNAME],ext[_MAX_EXT];
    char path_buffer[_MAX_PATH];
	strcpy((char*)path_buffer,FilePathName);
	_splitpath(path_buffer,drive,dir,fname,ext);
	
	tmpStr = drive;
	tmpStr += dir;
	return tmpStr;
}

CString  CSearchPath::GetFilePath(CString FileName,CString &strDrive,CString &strDir,CString &strName,CString&strExt)
{
	CString tmpStr;
	char drive[_MAX_DRIVE],dir[_MAX_DIR],fname[_MAX_FNAME],ext[_MAX_EXT];
    char path_buffer[_MAX_PATH];
	strcpy((char*)path_buffer,FileName);
	_splitpath(path_buffer,drive,dir,fname,ext);
	
	tmpStr = drive;
	tmpStr += dir;
	strDrive=drive;
	strDir=dir;
	strName=fname;
	strExt=ext;
	return tmpStr;
}


void CSearchPath::SetDefaultPath(void)
{
	char buffer[_MAX_PATH];
	CString strTemp =_T("");

	GetWindowsDirectory(buffer, _MAX_PATH);
	m_strSystemPath= CString(buffer) ;
	m_strSystem32Path =m_strSystemPath + "\\System32\\";
	
	::GetModuleFileName(AfxGetInstanceHandle(), buffer, _MAX_PATH);

		
	m_strProgramPath = GetFilePath(buffer);
	strTemp = m_strProgramPath.Left(m_strProgramPath.GetLength()-1);
	m_strHomePath = m_strProgramPath.Left(strTemp.ReverseFind('\\')+1);
	m_strProjectPath=m_strHomePath+"Project\\";//软件工程目录
//	CreateDirectory(m_strProjectPath,NULL);
	m_strSettingPath = m_strHomePath+"Setting\\";//软件设置目录
//	CreateDirectory(m_strSettingPath,NULL);
}



⌨️ 快捷键说明

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