本文整理汇总了C++中GetPrivateProfileInt函数的典型用法代码示例。如果您正苦于以下问题:C++ GetPrivateProfileInt函数的具体用法?C++ GetPrivateProfileInt怎么用?C++ GetPrivateProfileInt使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetPrivateProfileInt函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: ConfigExperimentFromFile
//.........这里部分代码省略.........
else if (strcmp(s,"tetrahedra")==0)
gRubbleType=TETRAHEDRA;
else if (strcmp(s,"mixed")==0)
gRubbleType=MIXED;
else if (strcmp(s,"convex")==0)
gRubbleType=CONVEX_POLYHEDRA;
else if (strcmp(s,"d12")==0)
gRubbleType=D12;
else if (strcmp(s,"capsules")==0)
gRubbleType=CAPSULES;
else if (strcmp(s,"mixed")==0)
gRubbleType=MIXED;
else
gRubbleType=BAD_RUBBLE_TYPE;
// Lander parameters
GetPrivateProfileString("experiment","lander_type","",s,255,iniFile);
if (strcmp(s,"capsule")==0)
gLanderType=CAPSULE_LANDER;
else if (strcmp(s,"sphere")==0)
gLanderType=SPHERE_LANDER;
else if (strcmp(s,"shaped_charge")==0)
gLanderType=SHAPED_CHARGE;
else if (strcmp(s,"roly_poly")==0)
gLanderType=ROLY_POLY;
else if (strcmp(s,"cubesat")==0)
gLanderType=CUBESAT;
else
gLanderType=BAD_LANDER_TYPE;
GetPrivateProfileString("experiment","lander_size.w","0",s,255,iniFile);
gLanderSize.x=atof(s);
GetPrivateProfileString("experiment","lander_size.h","0",s,255,iniFile);
gLanderSize.y=atof(s);
GetPrivateProfileString("experiment","lander_size.d","0",s,255,iniFile);
gLanderSize.z=atof(s);
if (gLanderType==ROLY_POLY) {
GetPrivateProfileString("experiment","roly_poly_radius","0",s,255,iniFile);
gLanderSize.x=atof(s);
GetPrivateProfileString("experiment","roly_poly_offset","0",s,255,iniFile);
gLanderSize.y=atof(s);
GetPrivateProfileString("experiment","roly_poly_hemisphere_ratio","1",s,255,iniFile);
gLanderSize.z=atof(s);
GetPrivateProfileString("experiment","roly_poly_weight_ratio","0",s,255,iniFile);
gRPWeight=atof(s);
}
GetPrivateProfileString("experiment","lander_mass","0",s,255,iniFile);
gLanderMass=atof(s);
GetPrivateProfileString("experiment","lander_mass_ratio","1",s,255,iniFile);
gLanderMassRatio=atof(s);
GetPrivateProfileString("experiment","landing_roughness","0",s,255,iniFile);
gLandingRoughness=atof(s);
GetPrivateProfileString("experiment","vibrator_amplitude","0",s,255,iniFile);
gVibrateAmp=atof(s);
GetPrivateProfileString("experiment","vibrator_frequency","0",s,255,iniFile);
gVibrateFreq=atof(s);
// rubble parameters
RUBBLE_SIZE=GetPrivateProfileInt("experiment","rubble_size",0,iniFile);
GetPrivateProfileString("experiment","grain_size","0",s,255,iniFile);
gRainSize=atof(s);
GetPrivateProfileString("experiment","gsd.amin","0.1",s,255,iniFile);
gsd[0]=atof(s);
GetPrivateProfileString("experiment","gsd.amax","1.0",s,255,iniFile);
gsd[1]=atof(s);
GetPrivateProfileString("experiment","gsd.alpha","4.0",s,255,iniFile);
gsd[2]=atof(s);
GetPrivateProfileString("experiment","gravitator_threshold_mass","0",s,255,iniFile);
gRavitatorThresholdMass=atof(s);
GetPrivateProfileString("experiment","cell_size","1",s,255,iniFile);
gCellSize=atof(s);
GetPrivateProfileString("experiment","grain_density","1000",s,255,iniFile);
gDefaultDensity=atof(s);
gDefaultNumVerts=GetPrivateProfileInt("experiment","num_verts",12,iniFile);
GetPrivateProfileString("experiment","vertex_spacing","10",s,255,iniFile);
gDefaultGam=atof(s);
GetPrivateProfileString("experiment","uniform_rubble","false",s,255,iniFile);
if (strcmp(s,"true")==0)
isUniformRubble=true;
else
isUniformRubble=false;
GetPrivateProfileString("experiment","control_mode","manual",s,255,iniFile);
if (strcmp(s,"manual")==0)
isManualControl=true;
else
isManualControl=false;
}
}
开发者ID:nmovshov,项目名称:ARSS_win,代码行数:101,代码来源:pods.cpp
示例2: GetPrivateProfileInt
//005535a0 -> 100%
int CMasterLevelSystem::MasterLevelUp(LPOBJ lpObj, __int64 iAddExp, bool bEventMapReward, int iMonsterType) //OK
{
if( !this->IsMasterLevelUser(lpObj) )
{
return false;
}
int m_maxMasterLevel = GetPrivateProfileInt("Common", "MaxMasterLevel", 200, gDirPath.GetNewPath("MasterSystem.cfg"));
int numCoded = 201;
if (m_maxMasterLevel >= numCoded || m_maxMasterLevel <= 0){
int m_maxMasterLevel = 200;
}
// ----
if (lpObj->m_nMasterLevel >= m_maxMasterLevel)
{
GCServerMsgStringSend(lMsg.Get(1136), lpObj->m_Index, 1);
return false;
}
// ----
if( bEventMapReward ) //-> New
{
iAddExp = iAddExp; //???
}
else
{
#ifdef GENS
if( gGensSystem.IsMapBattleZone(lpObj->MapNumber) ) //-> Original g_GensSystem maybe
{
iAddExp = iAddExp * (this->m_fAddExpRate + g_MLBattleZoneAddExp);
}
else
{
iAddExp = iAddExp * this->m_fAddExpRate;
}
#else
iAddExp = iAddExp * this->m_fAddExpRate;
#endif
}
// ----
if( lpObj->m_MPSkillOpt.MpsPlusExp > 0 )
{
iAddExp += iAddExp * lpObj->m_MPSkillOpt.MpsPlusExp / 100;
}
// ----
if( iAddExp > 0 )
{
gObjSetExpPetItem(lpObj->m_Index, iAddExp);
// ----
LogAddTD("ML Experience : Map[%d]-(%d,%d) [%s][%s](%d) %I64d %I64d MonsterIndex : %d", //-> Updated
lpObj->MapNumber, lpObj->X, lpObj->Y, lpObj->AccountID,lpObj->Name,
lpObj->m_nMasterLevel, lpObj->m_i64MasterLevelExp, iAddExp, iMonsterType);
// ----
if( iAddExp + lpObj->m_i64MasterLevelExp >= lpObj->m_i64NextMasterLevelExp )
{
iAddExp = 0;
// -----
int m_masterPointsPerLvl = GetPrivateProfileInt("Common", "MasterPointsPerLvl", 100, gDirPath.GetNewPath("MasterSystem.cfg"));
int numCodeds = 101;
if (m_maxMasterLevel >= numCodeds)
{
int m_masterPointsPerLvl = 1;
}
// -----
lpObj->m_i64MasterLevelExp = lpObj->m_i64NextMasterLevelExp;
lpObj->m_nMasterLevel++;
lpObj->m_iMasterLevelPoint += m_masterPointsPerLvl; //-> In future can use it for change ml point per level)
// -----
gObjCalCharacter(lpObj->m_Index);
// -----
lpObj->MaxLife += DCInfo.DefClass[ lpObj->Class ].LevelLife;
lpObj->MaxMana += DCInfo.DefClass[ lpObj->Class ].LevelMana;
lpObj->Life = lpObj->AddLife + lpObj->MaxLife;
lpObj->Mana = lpObj->AddMana + lpObj->MaxMana;
// -----
gObjCalcShieldPoint(lpObj);
lpObj->iShield = lpObj->iAddShield + lpObj->iMaxShield;
// -----
this->gObjNextMLExpCal(lpObj);
// ----
gObjCalcMaxLifePower(lpObj->m_Index);
gObjSetBP(lpObj->m_Index);
GJSetCharacterInfo(lpObj, lpObj->m_Index, 0, 0);
this->GCMasterLevelUpInfo(lpObj);
GCReFillSend(lpObj->m_Index, lpObj->Life, 0xFF, 0, lpObj->iShield);
GCManaSend(lpObj->m_Index, lpObj->Mana, 0xFF, 0, lpObj->BP); //-> Original name ->_BP
}
else
{
lpObj->m_i64MasterLevelExp += iAddExp;
}
// ----
GCSendExp_INT64(lpObj->m_Index, 65535, iAddExp, 0, 0);
}
// ----
return true;
}
开发者ID:Natzugen,项目名称:test,代码行数:97,代码来源:MasterLevelSystem.cpp
示例3: GetPrivateProfileInt
void cLuckyPenny::Read(char * FilePath)
{
this->Enabled = GetPrivateProfileInt("Common", "SCFLuckyPennyEnabled",0, FilePath);
LogAddTD("[SCFLuckyPenny] - %s file is Loaded",FilePath);
}
开发者ID:ADMTec,项目名称:GameServer,代码行数:6,代码来源:ObjLuckyPenny.cpp
示例4: GetPrivateProfileBool
inline bool GetPrivateProfileBool( LPCTSTR lpAppName,LPCTSTR lpKeyName,bool nDefault, LPCTSTR lpFileName)
{
return GetPrivateProfileInt( lpAppName,lpKeyName,nDefault,lpFileName) == 0 ? false : true;
}
开发者ID:motor,项目名称:clock_stimulus,代码行数:4,代码来源:cbUtil.cpp
示例5: GetPrivateProfileInt
int CIniFile::ReadInteger (LPCSTR lpszSection, LPCSTR lpszKey, int iDefault)
{
// read integer value from ini-file
return GetPrivateProfileInt (lpszSection, lpszKey, iDefault, m_szFileName);
}
开发者ID:TerrahKitsune,项目名称:TerrahIRC,代码行数:5,代码来源:IniFile.cpp
示例6: WinMain
int WINAPI WinMain( HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow )
{
MSG uMsg;
memset(&uMsg,0,sizeof(uMsg));
winClass.lpszClassName = "MY_WINDOWS_CLASS";
winClass.cbSize = sizeof(WNDCLASSEX);
winClass.style = CS_HREDRAW | CS_VREDRAW;
winClass.lpfnWndProc = WndProc;
winClass.hInstance = hInstance;
winClass.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_ICON1));
winClass.hIconSm = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_ICON1));
winClass.hCursor = LoadCursor(NULL, IDC_ARROW);
winClass.lpszMenuName = MAKEINTRESOURCE(IDC_CV);
winClass.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH);
winClass.cbClsExtra = 0;
winClass.cbWndExtra = 0;
if( !RegisterClassEx(&winClass) )
return E_FAIL;
GetINIPath();
OpenConsoleWindow = GetPrivateProfileBool("Display", "OpenConsoleWindow", true, IniName);
if (OpenConsoleWindow)
OpenConsole();
pcejin.aspectRatio = GetPrivateProfileBool("Video", "aspectratio", false, IniName);
pcejin.windowSize = GetPrivateProfileInt("Video", "pcejin.windowSize", 1, IniName);
WndX = GetPrivateProfileInt("Main", "WndX", 0, IniName);
WndY = GetPrivateProfileInt("Main", "WndY", 0, IniName);
g_hWnd = CreateWindowEx( NULL, "MY_WINDOWS_CLASS",
pcejin.versionName.c_str(),
WS_OVERLAPPEDWINDOW | WS_VISIBLE,
WndX, WndY, 348, 224, NULL, NULL, hInstance, NULL );
if( g_hWnd == NULL )
return E_FAIL;
ScaleScreen((float)pcejin.windowSize);
soundInit();
LoadIniSettings();
InitSpeedThrottle();
DirectDrawInit();
InitCustomControls();
InitCustomKeys(&CustomKeys);
LoadHotkeyConfig();
LoadInputConfig();
DragAcceptFiles(g_hWnd, true);
extern void Agg_init();
Agg_init();
if (osd) {delete osd; osd =NULL; }
osd = new OSDCLASS(-1);
di_init();
DWORD wmTimerRes;
TIMECAPS tc;
if (timeGetDevCaps(&tc, sizeof(TIMECAPS))== TIMERR_NOERROR)
{
wmTimerRes = std::min(std::max(tc.wPeriodMin, (UINT)1), tc.wPeriodMax);
timeBeginPeriod (wmTimerRes);
}
else
{
wmTimerRes = 5;
timeBeginPeriod (wmTimerRes);
}
if (KeyInDelayMSec == 0) {
DWORD dwKeyboardDelay;
SystemParametersInfo(SPI_GETKEYBOARDDELAY, 0, &dwKeyboardDelay, 0);
KeyInDelayMSec = 250 * (dwKeyboardDelay + 1);
}
if (KeyInRepeatMSec == 0) {
DWORD dwKeyboardSpeed;
SystemParametersInfo(SPI_GETKEYBOARDSPEED, 0, &dwKeyboardSpeed, 0);
KeyInRepeatMSec = (int)(1000.0/(((30.0-2.5)/31.0)*dwKeyboardSpeed+2.5));
}
if (KeyInRepeatMSec < (int)wmTimerRes)
KeyInRepeatMSec = (int)wmTimerRes;
if (KeyInDelayMSec < KeyInRepeatMSec)
KeyInDelayMSec = KeyInRepeatMSec;
hKeyInputTimer = timeSetEvent (KeyInRepeatMSec, 0, KeyInputTimer, 0, TIME_PERIODIC);
//.........这里部分代码省略.........
开发者ID:MANICX100,项目名称:vbjin,代码行数:101,代码来源:main.cpp
示例7: GetPrivateProfileInt
int CBaseIni::ReadInt( LPCTSTR lpszAppName, LPCTSTR lpszKeyName, int nDefault/*, LPCTSTR lpszFileName = NULL*/ )
{
return GetPrivateProfileInt( lpszAppName, lpszKeyName, nDefault, m_strFileName.c_str() );
}
开发者ID:sunnet2007,项目名称:vHome,代码行数:4,代码来源:base_ini.cpp
示例8: winSaveCheatListDefault
//.........这里部分代码省略.........
if(theApp.autoPatch && !patchName.IsEmpty()) {
int size = gbRomSize;
applyPatch(patchName, &gbRom, &size);
if(size != gbRomSize) {
extern bool gbUpdateSizes();
gbUpdateSizes();
gbReset();
theApp.romSize = size;
}
}
} else {
int size = CPULoadRom(theApp.szFile);
if(!size)
return false;
theApp.romSize = size;
flashSetSize(theApp.winFlashSize);
rtcEnable(theApp.winRtcEnable);
cpuSaveType = theApp.winSaveType;
GetModuleFileName(NULL, tempName, 2048);
char *p = strrchr(tempName, '\\');
if(p)
*p = 0;
char buffer[5];
strncpy(buffer, (const char *)&rom[0xac], 4);
buffer[4] = 0;
strcat(tempName, "\\vba-over.ini");
UINT i = GetPrivateProfileInt(buffer,
"rtcEnabled",
-1,
tempName);
if(i != (UINT)-1)
rtcEnable(i == 0 ? false : true);
i = GetPrivateProfileInt(buffer,
"flashSize",
-1,
tempName);
if(i != (UINT)-1 && (i == 0x10000 || i == 0x20000))
flashSetSize((int)i);
i = GetPrivateProfileInt(buffer,
"saveType",
-1,
tempName);
if(i != (UINT)-1 && (i <= 5))
cpuSaveType = (int)i;
i = GetPrivateProfileInt(buffer,
"mirroringEnabled",
-1,
tempName);
if(i != (UINT)-1)
doMirroring (i == 0 ? false : true);
theApp.emulator = GBASystem;
/* disabled due to problems
if(theApp.removeIntros && rom != NULL) {
*((u32 *)rom)= 0xea00002e;
}
*/
开发者ID:DBZ89,项目名称:VisualBoyAdvance-Core,代码行数:67,代码来源:MainWnd.cpp
示例9: GetPrivateProfileInt
void ImperialEvent::ImperialLoadConfig()
{
char FileName[] = "..//OptionsData//Events//ImperialEvent.ini";
ImperialConfig.MinimumLevel = GetPrivateProfileInt("ImperialGuardianFort", "ImperialEventReqLevel", 15, FileName);
ImperialConfig.CheckInvite = GetPrivateProfileInt("ImperialGuardianFort", "ImperialEventCheckPaper", 1, FileName);
}
开发者ID:brunohkbx,项目名称:pendmu-server,代码行数:6,代码来源:ImperialEvent.cpp
示例10: GetPrivateProfileInt
int CConfigManager::GetFontSize()
{
return GetPrivateProfileInt(m_section.c_str(), FONT_SIZE, 20, m_configFileName.c_str());
}
开发者ID:weimingtom,项目名称:gal-demo,代码行数:4,代码来源:ConfigManager.cpp
示例11: SetIcon
BOOL CUserLoginDlg::OnInitDialog()
{
CDialogEx::OnInitDialog();
HICON m_hIcon;
m_hIcon=AfxGetApp()->LoadIcon(IDR_MAINFRAME);//修改对话框的图标
SetIcon(m_hIcon,TRUE);
// TODO: 在此添加额外的初始化
ModifyStyleEx(0,WS_EX_APPWINDOW);
GetClientRect(&m_rect);
SetBackgroundColor(RGB(247,252,255));
//初始化全局变量g_CurrentDir(当前目录绝对路径)
GetCurrentDirectory(MAX_PATH,g_CurrentDir.GetBuffer(MAX_PATH));
g_CurrentDir.ReleaseBuffer();
//提取之前保存的用户信息,如果有的话,利用sqlite数据库
sqlite3* UserInfodb = NULL;
//打开数据库,不存在则创建
if(sqlite3_open("User\\UserInfo.db3", &UserInfodb) != 0)
{
MessageBox(L"打开用户信息列表失败",L"初始化",MB_ICONERROR);
return FALSE;
}
//创建用户信息表格,已存在则创建失败,错误信息保存在szErrmsg中
char *sqlcmd = "CREATE TABLE UserInfo(\
UserName string PRIMARY KEY,\
PassWord string )";
char *szErrmsg = NULL;
sqlite3_exec(UserInfodb,sqlcmd,0,0,&szErrmsg);
//查询用户数据
char *zsql = "SELECT * FROM UserInfo";
char **szResult = NULL;
int nRow = 0;
int nColumn = 0;
sqlite3_get_table(UserInfodb,zsql,&szResult,&nRow,&nColumn,&szErrmsg);
char username[MAX_USERNAMELEN] = {0};
char passwordEncodeHex[500] = {0};
char *passwordEncode = NULL;
memset(username,0,MAX_USERNAMELEN);
memset(passwordEncodeHex,0,500);
int l = strlen(szResult[3]);
if(nRow)
{
memcpy(username,szResult[2],strlen(szResult[2]));
memcpy(passwordEncodeHex,szResult[3],strlen(szResult[3]));
}
m_UserIniFilePath = g_CurrentDir;
m_UserIniFilePath+=L"\\config\\config.ini";
m_UserName = Char2CString(username);
m_CheckPW=GetPrivateProfileInt(L"UserSetting",L"SavePassword",0,m_UserIniFilePath);
if(strlen(passwordEncodeHex))
{
//如果密码不为空,则解密
char *userKey = "1234567887654321"; // 原始密钥128位,16字节
CString sDataLen;
GetPrivateProfileString(L"UserSetting",L"PasswordEnCodeLen",L"",sDataLen.GetBuffer(10),10,m_UserIniFilePath);
int datalen = _wtoi(sDataLen);
char keyDecode[256]; //解密密钥
char *PassWordDecoded = NULL;
//char *dataSrc = NULL; //补齐的数据
//将转为16进制串的密码转为初始状态
int L=strlen(passwordEncodeHex);
passwordEncode = (char*)malloc(sizeof(char)*(L));
memset(passwordEncode,0,L);
int x;
for(int i=0;i<L/2;i++)
{
sscanf(passwordEncodeHex+i*2,"%02X",&x);
passwordEncode[i]=(char)x;//(x&0xFFu);
}
unsigned char in[16];
unsigned char out[16];
PassWordDecoded = (char*)malloc(sizeof(char)*datalen);
if(!PassWordDecoded)
{
return -1;
}
memset(PassWordDecoded,0,datalen);
//设置解密密钥
if(0!=AES_set_decrypt_key((const unsigned char *)userKey,128,(AES_KEY *)keyDecode))
{
return -1;
}
//循环加密,以16字节为单位
int count = datalen/16;
//解密
for(int i = 0;i<count;++i)
{
memset(in, 0, 16);
memset(out, 0, 16);
memcpy(in,passwordEncode+i*16,16);
AES_ecb_encrypt(in,out,(AES_KEY *)keyDecode,AES_DECRYPT);
memcpy(PassWordDecoded+i*16,out,16);
}
//初始化密码
//.........这里部分代码省略.........
开发者ID:wth515812076,项目名称:WineAnaSys,代码行数:101,代码来源:UserLoginDlg.cpp
示例12: GetPrivateProfileInt
bool CRtkService::_init()
{
char serverName[rtkm_node_key_length + 1];
m_bPending = __true;
PrimaryCheckInterval = GetPrivateProfileInt(
"PMC",
"PrimaryCheckInterval",
500,
get_config_file()
);
if(PrimaryCheckInterval < 50 || PrimaryCheckInterval > 5000){
utils_error(
"Warning : PrimaryCheckInterval=%d is invalid, reset to 500.\n",
PrimaryCheckInterval
);
PrimaryCheckInterval = 500;
}
MaxPrimaryWatchDogCounter = GetPrivateProfileInt(
"PMC",
"PrimaryWatchDogCounter",
8,
get_config_file()
);
if(MaxPrimaryWatchDogCounter < 3 || MaxPrimaryWatchDogCounter > 50){
utils_error(
"Warning : PrimaryWatchDogCounter=%d is invalid, reset to 20.\n",
PrimaryWatchDogCounter
);
MaxPrimaryWatchDogCounter = 8;
}
PrimaryWatchDogCounter = MaxPrimaryWatchDogCounter;
m_bPending = __false;
init_powermgr();
#ifdef _WIN32
init_spac();//初始化得到security descriptor、mutex对象句柄数组mutics[]和event对象句柄数组events[]
#endif
init_server_shell();//创建g_shell
init_config();//空函数。。。
GetPrivateProfileString(
"PMC",
"ServerName",
"",
serverName,
sizeof(serverName),
get_config_file()
);
//若pmc.ini中没有给出节点名,取本机名为节点名
if(!serverName[0]){
DWORD len;
len = sizeof(serverName);
GetComputerName(serverName, &len);
}
//初始化网络,即设定一些值,创建链表g_buses,<bus_id, CRtkVBus*>,并开启5个VBUS线程
if(!init_network(RTK_INIT_AS_SERVER, serverName)){
return false;
}
//给g_buses中的4个元素的CRtkVBus的成员赋值
connect_vbus(
BUSID_RTDB,
VBUS_CONNECT_AS_SERVER,
on_rtdb,
rtdb_filter
);
connect_vbus(
BUSID_SYSTEM,
VBUS_CONNECT_AS_SERVER,
on_system,
server_filter
);
connect_vbus(
BUSID_OPERATION,
VBUS_CONNECT_AS_SERVER,
on_operation,
server_filter
);
connect_vbus(
BUSID_CONFIG,
VBUS_CONNECT_AS_SERVER,
on_config,
server_filter
);
utils_trace("Networking Subsystem initialized.\n");
register_power_callback(power_state_changed, 0);//创建一个CALLBACK_ITEM,用形参给其成员赋值,并链接上RTK_LIST_ENTRY
// checking primary site
if(!setup_running_state()){
return false;
}
setup_rtdb();//在pmc.ini中寻找组名,加载组名对应的*.csv文件中的标签到内存,并开启一个线程。
utils_trace("Realtime Database Subsystem initialized.\n");
//.........这里部分代码省略.........
开发者ID:george-kuo,项目名称:GoSysWare,代码行数:101,代码来源:rtkserver.cpp
示例13: GetPrivateProfileInt
UINT ConfigManager::ReadInt(char *key, int def)
{
return GetPrivateProfileInt(APPNAME, key, def, mIniFile);
}
开发者ID:noxdominus,项目名称:httpq2,代码行数:4,代码来源:configmanager.cpp
示例14: TMSRPT29
//
// Load driver data from an external file into the drivers table
//
BOOL FAR TMSRPT29(TMSRPTPassedDataDef *pPassedData)
{
BOOL bOK;
BOOL bFileOpen[NUMINPUTFILES];
BOOL bFound;
FILE *fp[NUMINPUTFILES];
char blanks[80];
char dummy[256];
char inputString[256];
char inputFiles[NUMINPUTFILES][16];
char nodeNumbers[256];
char *ptr;
char routeNumber[ROUTES_NAME_LENGTH + 1];
char routeName[ROUTES_NAME_LENGTH + 1];
char serviceName[SERVICES_NAME_LENGTH + 1];
long directionIndex;
long firstTime;
long nodeSequence;
long PATTERNSrecordID;
long ROUTESrecordID;
long SERVICESrecordID;
long tempLong;
long oldCount;
long newCount;
int nI;
int nJ;
int rcode2;
bOK = TRUE;
memset(blanks, ' ', 80);
for(nI = 0; nI < NUMINPUTFILES; nI++)
{
bFileOpen[nI] = FALSE;
}
//
// Give the warning
//
LoadString(hInst, ERROR_278, tempString, TEMPSTRING_LENGTH);
if(MessageBox(NULL, tempString, TMS, MB_YESNO | MB_ICONWARNING | MB_DEFBUTTON2) == IDNO)
{
bOK = FALSE;
goto done;
}
//
// Get the list of divisions we're going to load
//
// Number of divisions
//
numDivisions = GetPrivateProfileInt("TMSRPT29", "numDivisions", 0, TMSINIFile);
if(numDivisions == 0)
{
LoadString(hInst, ERROR_273, tempString, TEMPSTRING_LENGTH);
MessageBox(NULL, tempString, TMS, MB_OK);
bOK = FALSE;
goto done;
}
//
// Did we exceed the max?
//
if(numDivisions > MAXDIVISIONS)
{
LoadString(hInst, ERROR_274, tempString, TEMPSTRING_LENGTH);
MessageBox(NULL, tempString, TMS, MB_OK);
bOK = FALSE;
goto done;
}
//
// Loop through the divisions?
//
for(nI = 0; nI < numDivisions; nI++)
{
sprintf(tempString, "DivisionNumber%02d", nI);
divisionList[nI] = GetPrivateProfileInt("TMSRPT29", tempString, NO_RECORD, TMSINIFile);
if(divisionList[nI] == NO_RECORD)
{
LoadString(hInst, ERROR_275, szFormatString, sizeof(szFormatString));
sprintf(szarString, szFormatString, tempString);
MessageBox(NULL, szarString, TMS, MB_OK);
bOK = FALSE;
goto done;
}
sprintf(tempString, "DivisionName%02d", nI);
GetPrivateProfileString("TMSRPT29", tempString, "",
szarString, sizeof(szarString), TMSINIFile);
//
// Set up the Divisions Table
//
rcode2 = btrieve(B_GETLAST, TMS_DIVISIONS, &DIVISIONS, &DIVISIONSKey0, 0);
DIVISIONS.recordID = AssignRecID(rcode2, DIVISIONS.recordID);
DIVISIONS.COMMENTSrecordID = NO_RECORD;
DIVISIONS.number = divisionList[nI];
strncpy(DIVISIONS.name, szarString, DIVISIONS_NAME_LENGTH);
pad(DIVISIONS.name, DIVISIONS_NAME_LENGTH);
memset(DIVISIONS.reserved, 0x00, DIVISIONS_RESERVED_LENGTH);
DIVISIONS.flags = 0;
rcode2 = btrieve(B_INSERT, TMS_DIVISIONS, &DIVISIONS, &DIVISIONSKey0, 0);
//
//.........这里部分代码省略.........
开发者ID:ems,项目名称:TMS,代码行数:101,代码来源:Tmsrpt29.c
示例15: GetPrivateProfileInt
int IniReader::ReadInteger(char* szSection, char* szKey, int iDefaultValue)
{
int iResult = GetPrivateProfileInt(szSection, szKey, iDefaultValue, m_szFileName);
return iResult;
}
开发者ID:cret91,项目名称:metin2-open-file-manager,代码行数:5,代码来源:ConfigurationHandler.cpp
示例16: GetModuleIniPath
BOOL CSyoboiCalUtil::SendReserve(vector<RESERVE_DATA*>* reserveList, vector<TUNER_RESERVE_INFO>* tunerList)
{
if( reserveList == NULL || tunerList == NULL ){
return FALSE;
}
if( reserveList->size() == 0 ){
return FALSE;
}
wstring iniAppPath = L"";
GetModuleIniPath(iniAppPath);
if( GetPrivateProfileInt(L"SYOBOI", L"use", 0, iniAppPath.c_str()) == 0 ){
return FALSE;
}
_OutputDebugString(L"★SyoboiCalUtil:SendReserve");
wstring textPath;
GetModuleFolderPath(textPath);
textPath += L"\\SyoboiCh.txt";
CParseServiceChgText srvChg;
srvChg.ParseText(textPath.c_str());
SAFE_DELETE(this->proxyInfo);
WCHAR buff[512] = L"";
int length = 0;
BOOL useProxy = (BOOL)GetPrivateProfileInt(L"SYOBOI", L"useProxy", 0, iniAppPath.c_str());
if( useProxy == TRUE ){
this->proxyInfo = new USE_PROXY_INFO;
GetPrivateProfileString(L"SYOBOI", L"ProxyServer", L"", buff, 512, iniAppPath.c_str());
this->proxyInfo->serverName = new WCHAR[wcslen(buff)+1];
wcscpy_s(this->proxyInfo->serverName, wcslen(buff)+1, buff);
ZeroMemory(buff, (sizeof(WCHAR)*512));
GetPrivateProfileString(L"SYOBOI", L"ProxyID", L"", buff, 512, iniAppPath.c_str());
length = (int)wcslen(buff);
if( length > 0 ){
this->proxyInfo->userName = new WCHAR[length+1];
wcscpy_s(this->proxyInfo->userName, length+1, buff);
}else{
this->proxyInfo->userName = NULL;
}
ZeroMemory(buff, (sizeof(WCHAR)*512));
GetPrivateProfileString(L"SYOBOI", L"ProxyPWD", L"", buff, 512, iniAppPath.c_str());
length = (int)wcslen(buff);
if( length > 0 ){
this->proxyInfo->password = new WCHAR[length+1];
wcscpy_s(this->proxyInfo->password, length+1, buff);
}else{
this->proxyInfo->password = NULL;
}
}
ZeroMemory(buff, (sizeof(WCHAR)*512));
GetPrivateProfileString(L"SYOBOI", L"userID", L"", buff, 512, iniAppPath.c_str());
this->id=buff;
ZeroMemory(buff, (sizeof(WCHAR)*512));
GetPrivateProfileString(L"SYOBOI", L"PWD", L"", buff, 512, iniAppPath.c_str());
this->pass=buff;
int slot = GetPrivateProfileInt(L"SYOBOI", L"slot", 0, iniAppPath.c_str());
ZeroMemory(buff, (sizeof(WCHAR)*512));
GetPrivateProfileString(L"SYOBOI", L"devcolors", L"", buff, 512, iniAppPath.c_str());
wstring devcolors=buff;
ZeroMemory(buff, (sizeof(WCHAR)*512));
GetPrivateProfileString(L"SYOBOI", L"epgurl", L"", buff, 512, iniAppPath.c_str());
wstring epgurl=buff;
if( this->id.size() == 0 ){
_OutputDebugString(L"★SyoboiCalUtil:NoUserID");
return FALSE;
}
//Authorization
wstring auth = L"";
auth = this->id;
auth += L":";
auth += this->pass;
string authA;
WtoA(auth, authA);
DWORD destSize = 0;
Base64Enc(authA.c_str(), (DWORD)authA.size(), NULL, &destSize);
WCHAR* base64 = new WCHAR[destSize];
ZeroMemory(base64, destSize*sizeof(WCHAR));
Base64Enc(authA.c_str(), (DWORD)authA.size(), base64, &destSize);
wstring authHead = L"";
Format(authHead, L"Authorization: Basic %s\r\nContent-type: application/x-www-form-urlencoded\r\n", base64);
//data
wstring dataParam;
wstring param;
map<DWORD, wstring> tunerMap;
for( size_t i=0; i<tunerList->size(); i++ ){
//.........这里部分代码省略.........
开发者ID:HK323232,项目名称:EDCB,代码行数:101,代码来源:SyoboiCalUtil.cpp
示例17: GetPrivateProfileInt
int CZQIniFile::ReadInteger(char* szSection, char* szKey, int iDefaultValue)
{
int iResult = GetPrivateProfileInt((LPCSTR)szSection, (LPCSTR)szKey, iDefaultValue, (LPCSTR)m_szFileName);
return iResult;
}
开发者ID:mikesimb,项目名称:SkinDemo_1,代码行数:5,代码来源:ZQIniFile.cpp
示例18: GetPrivateProfileInt
int Ini::ReadInt(const char* key, int defaultValue, const char* section) const
{
return GetPrivateProfileInt(GetSection(section), key, defaultValue, _fname.c_str());
}
开发者ID:alanlei,项目名称:sp_server,代码行数:4,代码来源:ini.cpp
示例19: myGetProfileInt
UINT WINAPI myGetProfileInt(LPCTSTR lpAppName, LPCTSTR lpKeyName, INT nDefault)
{
return GetPrivateProfileInt(lpAppName, lpKeyName, nDefault, pszFilename);
}
开发者ID:kichik,项目名称:nsis-1,代码行数:4,代码来源:InstallerOptions.cpp
示例20: IniFileRead
extern int IniFileRead(TCHAR *ass_type, ass_setting_t *as)
{
int ret = -1;
// Allocate string buffers.
TCHAR *ini_file = new TCHAR[FILE_PATH_MAX];
TCHAR *tmp_buff = new TCHAR[INI_STRING_MAX];
WCHAR *utf8_str = new WCHAR[INI_STRING_MAX];
if (!ini_file || !tmp_buff || !utf8_str)
goto EXIT;
// Initliaze string buffers.
memset(ini_file, 0, sizeof(TCHAR) * FILE_PATH_MAX);
memset(tmp_buff, 0, sizeof(TCHAR) * INI_STRING_MAX);
memset(utf8_str, 0, sizeof(WCHAR) * INI_STRING_MAX);
// Get the file path of ini file.
if (GetPrivateProfilePath(ini_file))
goto EXIT;
// Open ini file.
FILE *fp = NULL;
if (_tfopen_s(&fp, ini_file, _T("r")) || !fp) {
if (_tfopen_s(&fp, ini_file, _T("wb")) || !fp)
goto EXIT;
fprintf(fp, "%s", DEFAULT_INI);
}
fclose(fp);
// Caption offset of SWF-Mode
as->SWF0offset=GetPrivateProfileInt(_T("SWFModeOffset"), _T("SWF0offset"), 0, ini_file);
as->SWF5offset=GetPrivateProfileInt(_T("SWFModeOffset"), _T("SWF5offset"), 0, ini_file);
as->SWF7offset=GetPrivateProfileInt(_T("SWFModeOffset"), _T("SWF7offset"), 0, ini_file);
as->SWF9offset=GetPrivateProfileInt(_T("SWFModeOffset"), _T("SWF9offset"), 0, ini_file);
as->SWF11offset=GetPrivateProfileInt(_T("SWFModeOffset"), _T("SWF11offset"), 0, ini_file);
// ass header infomation
#define GET_INI_STRING(sec, key, def, tmp, str, len, ini, get) \
do { \
GetPrivateProfileString(sec, key, def, tmp, len, ini); \
MultiByteToWideChar(932, 0, tmp, -1, str, len); \
WideCharToMultiByte(CP_UTF8, 0, str, -1, get, len, NULL, NULL); \
} while (0)
#define GET_INI_VALUE(sec, key, def, ini, get) \
do { \
get = GetPrivateProfileInt(sec, key, def, ini); \
} while (0)
GET_INI_STRING(ass_type, _T("Comment1"), NULL, tmp_buff, utf8_str, INI_STRING_MAX, ini_file, as->Comment1);
GET_INI_STRING(ass_type, _T("Comment2"), NULL, tmp_buff, utf8_str, INI_STRING_MAX, ini_file, as->Comment2);
GET_INI_STRING(ass_type, _T("Comment3"), NULL, tmp_buff, utf8_str, INI_STRING_MAX, ini_file, as->Comment3);
GET_INI_VALUE(ass_type, _T("PlayResX"), 1920, ini_file, as->PlayResX);
GET_INI_VALUE(ass_type, _T("PlayResY"), 1080, ini_file, as->PlayResY);
GET_INI_STRING(ass_type, _T("DefaultFontname"), _T("MS UI Gothic"), tmp_buff, utf8_str, INI_STRING_MAX, ini_file, as->DefaultFontname);
GET_INI_VALUE(ass_type, _T("DefaultFontsize"), 90, ini_file, as->DefaultFontsize);
GET_INI_STRING(ass_type, _T("DefaultStyle"), _T("&H00FFFFFF,&H000000FF,&H00000000,&H00000000,0,0,0,0,100,100,15,0,1,2,2,1,10,10,10,0")
, tmp_buff, utf8_str, INI_STRING_MAX, ini_file, as->DefaultStyle);
GET_INI_STRING(ass_type, _T("BoxFontname"), _T("MS UI Gothic"), tmp_buff, utf8_str, INI_STRING_MAX, ini_file, as->BoxFontname);
GET_INI_VALUE(ass_type, _T("BoxFontsize"), 90, ini_file, as->BoxFontsize);
GET_INI_STRING(ass_type, _T("BoxStyle"), _T("&HFFFFFFFF,&H000000FF,&H00FFFFFF,&H00FFFFFF,0,0,0,0,100,100,0,0,1,2,2,2,10,10,10,0")
, tmp_buff, utf8_str, INI_STRING_MAX, ini_file, as->BoxStyle);
GET_INI_STRING(ass_type, _T("RubiFontname"), _T("MS UI Gothic"), tmp_buff, utf8_str, INI_STRING_MAX, ini_file, as->RubiFontname);
GET_INI_VALUE(ass_type, _T("RubiFontsize"), 50, ini_file, as->RubiFontsize);
GET_INI_STRING(ass_type, _T("RubiStyle"), _T("&H00FFFFFF,&H000000FF,&H00000000,&H00000000,0,0,0,0,100,100,0,0,1,2,2,1,10,10,10,0")
, tmp_buff, utf8_str, INI_STRING_MAX, ini_file, as->RubiStyle);
#undef GET_INI_STRING
#undef GET_INI_VALUE
ret = 0;
EXIT:
SAFE_DELETE_ARRAY(ini_file);
SAFE_DELETE_ARRAY(tmp_buff);
SAFE_DELETE_ARRAY(utf8_str);
return ret;
}
开发者ID:myfingerhurt,项目名称:Caption2Ass_PCR,代码行数:78,代码来源:IniFile.cpp
注:本文中的GetPrivateProfileInt函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论