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

📄 mfx_function.cpp

📁 这是一个程序的一般架构方法
💻 CPP
字号:
//-- {CycleCode: 273} file [0..544]
//-- {AddDecl: 274} module.includes preserve=yes [0..191]
//## begin module.includes preserve=yes
// MFX_Function.cpp: implementation of the MFX_Function class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
//#include "MFX_Function.h"

//## end module.includes preserve=yes
//-- {StartSubRegion: 275} region.conditional [192..206]
#ifdef _DEBUG
//-- {AddDecl: 276} module.vulnerableDeclarations [207..282]
//## begin module.additionalDeclarations preserve=yes
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
//## end module.additionalDeclarations
//-- {StartSubRegion: 277} region.conditional [283..290]
#endif
//-- {AddDecl: 278} module.vulnerableDeclarations [291..544]
//## begin module.epilog preserve=yes

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
//获取Model文件夹
//获取执行文件路径
CString MFXGetModelPath( )
{
	CString strModule;
	::GetModuleFileName(AfxGetInstanceHandle(), strModule.GetBufferSetLength(MAX_PATH+1), MAX_PATH+1);
	int nIndex = strModule.ReverseFind('\\');
	ASSERT(nIndex <= strModule.GetLength());
	strModule = strModule.Left(nIndex + 1);
	return strModule;
}

//四舍五入
long MFXRounding(double x)
{
	if( x > 0 ) 
		return  long( x + 0.5 + 10.0 * MAX_ZORE_DOUBLE );
    else
		return  long( x - 0.5 - 10.0 * MAX_ZORE_DOUBLE );
} 

//访问共用内存块
void * MFXGetMemShareBlack(UINT nSize)
{
	return CMemStackManageBase::GetSignleton()->Lock(nSize);
}

//释放共用内存块
void MFXUnLockMemShareBlack()
{
	CMemStackManageBase::GetSignleton()->UnLock();
}



//## end module.epilog

⌨️ 快捷键说明

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