📄 gnugkappconfig.cpp
字号:
/*=============================================================
Function:
Author: Leon Wang <wlywly@sina.com giga2@tom.com>
==============================================================*/
// GnuGkAppConfig.cpp: implementation of the GnuGkAppConfig class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "GnuGkAppConfig.h"
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
//##ModelId=424BB6450396
GnuGkAppConfig::GnuGkAppConfig()
{
m_inipath = getAppPath();
}
//##ModelId=424BB64503A1
GnuGkAppConfig::~GnuGkAppConfig()
{
}
//##ModelId=424BB6450392
int GnuGkAppConfig::getConfigKey(CString section,CString configKey, int defaultValue)
{
char tempChar[MAX_PATH];
GetPrivateProfileString(section,configKey,"",tempChar,MAX_PATH,m_inipath);
defaultValue = atoi(tempChar);
return defaultValue;
}
//##ModelId=424BB6450382
CString GnuGkAppConfig::getConfigKey(CString section,CString configKey, CString defaultValue)
{
char tempChar[MAX_PATH];
GetPrivateProfileString(section,configKey,"",tempChar,MAX_PATH,m_inipath);
defaultValue = CString(tempChar);
return defaultValue;
}
// get application configuration file work path
//##ModelId=424BB64503A3
CString GnuGkAppConfig::getAppPath()
{
char pt[MAX_PATH] ;
CString appname = "ACDX";
GetFullPathName(appname+".exe",MAX_PATH,pt,NULL);
CString pathtp(pt);
pathtp.TrimLeft();
pathtp.TrimRight();
int pos = pathtp.ReverseFind('\\');
pathtp = pathtp.Mid(0,pos);
CString inipath = "";
inipath += pathtp;
inipath +="\\"+appname+".ini";
return inipath;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -