本文整理汇总了C++中KIniFile::Load方法的典型用法代码示例。如果您正苦于以下问题:C++ KIniFile::Load方法的具体用法?C++ KIniFile::Load怎么用?C++ KIniFile::Load使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KIniFile
的用法示例。
在下文中一共展示了KIniFile::Load方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ConnectAccountServer
//--------------------------------------------------------------------------
// 功能:连接游戏服务
//--------------------------------------------------------------------------
int KLogin::ConnectAccountServer(const unsigned char* pIpAddress)
{
KIniFile IniFile;
if (pIpAddress && IniFile.Load("\\Config.ini"))
{
int nPort;
IniFile.GetInteger("Server", "GameServPort", 8888, &nPort);
return g_NetConnectAgent.ClientConnectByNumericIp(pIpAddress, nPort);
}
return false;
}
示例2: LoadScheme
//--------------------------------------------------------------------------
// 功能:载入窗口的界面方案
//--------------------------------------------------------------------------
void KUiParadeItem::LoadScheme(const char* pScheme)
{
if (m_pSelf)
{
char Buff[128];
KIniFile Ini;
sprintf(Buff, "%s\\%s", pScheme, SCHEME_INI);
if (Ini.Load(Buff))
m_pSelf->LoadScheme(&Ini);
}
}
示例3: Error_Box
/**************************************************************************
*功能:弹出错误描述窗口
***************************************************************************/
void Error_Box()
{
if(s_uErrorCode)
{
KIniFile Ini;
char szFormatString[512], szOutputInfo[512], szBuf[16];
//嗷,开始显示错误信息咯
Ini.Load(ERROR_STRING);
Ini.GetString("Strings", itoa(s_uErrorCode,szBuf,10), "", szFormatString, sizeof(szFormatString));
if(szFormatString[0] == 0)
{
Ini.GetString("Strings", "Unknown", "", szFormatString, sizeof(szFormatString));
if(szFormatString[0] == 0)
strcpy(szFormatString, "未知的错误(错误号: %d)");
}
while(true)
{
char* pszNextLine = strchr(szFormatString, NEXT_LINE_CHARA);
if (pszNextLine == NULL)
break;
*pszNextLine = '\n';
}
const char* pszCodePos = strstr(szFormatString, "%d");
const char* pszStringPos = strstr(szFormatString, "%s");
if (pszCodePos)
{
if (pszStringPos)
{
if (pszCodePos < pszStringPos)
sprintf(szOutputInfo, szFormatString, s_uErrorCode, s_szErrorString);
else
sprintf(szOutputInfo, szFormatString, s_szErrorString, s_uErrorCode);
}
else
{
sprintf(szOutputInfo, szFormatString, s_uErrorCode);
}
}
else if (pszStringPos)
{
sprintf(szOutputInfo, szFormatString, s_szErrorString);
}
else
strcpy(szOutputInfo, szFormatString);
MessageBox(NULL, szOutputInfo, "剑侠情缘网络版", MB_OK | MB_ICONERROR);
s_uErrorCode = 0;
}
s_szErrorString[0] = 0;
}
示例4: LoadScheme
void KUiTaskNote_System::LoadScheme(const char* pScheme)
{
char Buff[128];
KIniFile Ini;
sprintf(Buff, "%s\\%s", pScheme, SCHEME_INI_SYSTEM);
if (Ini.Load(Buff))
{
KWndPage::Init(&Ini, "Main");
m_BtnDelete.Init(&Ini, "DeleteBtn");
m_RecordList.Init(&Ini, "List");
}
}
示例5: UiSoundLoadSetting
//载入设定
bool UiSoundLoadSetting()
{
KIniFile Setting;
if (!Setting.Load(SETTING_FILE))
return false;
char szSection[8];
for (int i = 0; i < (int)UI_SOUND_COUNT; i++)
{
itoa(i, szSection, 10);
Setting.GetString("Ui", szSection, "", s_SoundFileName[i], sizeof(s_SoundFileName[i]));
}
return true;
}
示例6: LoadScheme
void KUiSelPlayerNearby::LoadScheme(const char* pScheme)
{
if (m_pSelf)
{
char Buff[128];
KIniFile Ini;
sprintf(Buff, "%s\\%s", pScheme, SCHEME_INI);
if (Ini.Load(Buff))
{
m_pSelf->LoadScheme(&Ini);
}
}
}
示例7: LoadScheme
//载入界面方案
void KUiHeaderControlBar::LoadScheme(const char* pScheme)
{
char Buff[128];
KIniFile Ini;
if (m_pSelf)
{
sprintf(Buff, "%s\\"SCHEME_INI, pScheme);
if (Ini.Load(Buff))
{
m_pSelf->Init(&Ini, "Main");
}
}
}
示例8: LoadScheme
//载入界面方案
void KMouseOver::LoadScheme(const char* pScheme)
{
if (pScheme == NULL)
return;
char Buff[128];
KIniFile Ini;
sprintf(Buff, "%s\\%s", pScheme, SCHEME_INI);
if (Ini.Load(Buff))
{
Ini.GetInteger("Main", "ImgWidth", 0, &m_nImgWidth);
Ini.GetInteger("Main", "ImgHeight", 0, &m_nImgHeight);
Ini.GetInteger("Main", "Indent", 0, &m_nIndent);
Ini.GetInteger("Main", "Font", 0, &m_nFontSize);
if(m_nImgWidth < 0)
m_nImgWidth = 0;
if(m_nImgHeight < 0)
m_nImgWidth = 0;
if(m_nFontSize < 8)
m_nFontSize = 8;
int nValue;
Ini.GetInteger("Main", "ImgType", 0, &nValue);
if (nValue == 1)
{
m_Image.nType = ISI_T_BITMAP16;
m_Image.bRenderStyle = IMAGE_RENDER_STYLE_OPACITY;
}
else
{
m_Image.nType = ISI_T_SPR;
m_Image.bRenderStyle = IMAGE_RENDER_STYLE_ALPHA;
m_Image.Color.Color_b.a = 255;
}
m_Image.uImage = 0;
m_Image.nISPosition = IMAGE_IS_POSITION_INIT;
Ini.GetString("Main", "Image", "" , m_Image.szImage, sizeof(m_Image.szImage));
Ini.GetInteger("Main", "Frame", 0, &nValue);
m_Image.nFrame = nValue;
Ini.GetString("Main", "TitleBgColor", "0, 0, 0", Buff, sizeof(Buff));
m_uTitleBgColor = ((GetColor(Buff) & 0xffffff) | 0x0a000000);
Ini.GetString("Main", "PropBgColor", "0, 0, 0", Buff, sizeof(Buff));
m_uPropBgColor = ((GetColor(Buff) & 0xffffff) | 0x0a000000);
Ini.GetString("Main", "DescBgColor", "0, 0, 0", Buff, sizeof(Buff));
m_uDescBgColor = ((GetColor(Buff) & 0xffffff) | 0x0a000000);
Update((m_nLeft + m_nWndWidth) / 2, m_nTop);
}
}
示例9: GetTable
//---------------------------------------------------------------------------
// 功能: 从排序文件中把排序信息读取出来
// 参数:
// lpszFileName: 排序文件名
// *cActionName: 用于获取动作的各种信息
// nPartNum:部件的数量
// 返回: 读取成功与否
//---------------------------------------------------------------------------
BOOL CSortTable::GetTable(char *lpszFileName, CActionName *cActionName, int nPartNum)
{
if ( !lpszFileName || !lpszFileName[0])
return FALSE;
char szBuf[FILE_NAME_LENGTH];
KIniFile SortIni;
// g_SetFilePath(RES_INI_FILE_PATH);
g_UnitePathAndName(RES_INI_FILE_PATH, lpszFileName, szBuf);
if ( !SortIni.Load(szBuf) )
return FALSE;
return GetTable(&SortIni, cActionName, nPartNum);
}
示例10: LoadScheme
//--------------------------------------------------------------------------
// 功能:载入窗口的界面方案
//--------------------------------------------------------------------------
void KUiNewPlayerStartMsg::LoadScheme(const char* pScheme)
{
char Buff[128];
KIniFile Ini;
sprintf(Buff, "%s\\%s", pScheme, SCHEME_INI_NEWENTERINFO);
if (Ini.Load(Buff))
{
KWndShowAnimate::Init(&Ini, "Main");
m_List .Init(&Ini, "List");
m_AdvanceList .Init(&Ini, "List");
m_NewerBtn .Init(&Ini, "NewerBtn");
m_AdvanceBtn .Init(&Ini, "AdvanceNewerBtn");
m_Ok .Init(&Ini, "Ok");
}
}
示例11: LoadScheme
// -------------------------------------------------------------------------
// 功能 : 载入界面方案
// -------------------------------------------------------------------------
void KUiStoreBox::LoadScheme(const char* pScheme)
{
char Buff[128];
KIniFile Ini;
sprintf(Buff, "%s\\%s", pScheme, SCHEME_INI_ITEM);
if (m_pSelf && Ini.Load(Buff))
{
m_pSelf->Init(&Ini, "Main");
m_pSelf->m_Money.Init(&Ini, "Money");
m_pSelf->m_GetMoneyBtn.Init(&Ini, "GetMoneyBtn");
m_pSelf->m_CloseBtn.Init(&Ini, "CloseBtn");
m_pSelf->m_ItemBox.Init(&Ini, "ItemBox");
m_pSelf->m_ItemBox.EnableTracePutPos(true);
}
}
示例12: Init
BOOL KInlinePicSink::Init(iRepresentShell* pShell)
{
m_pRepShell = pShell;
if (!m_pRepShell)
return FALSE;
KIniFile ini;
#define CHAR_BUFFER_LEN 32
char szBuffer[CHAR_BUFFER_LEN * 2], szIndex[8];
int nPicCount = 0, i = 0;
KUiImageRef CurrentImg;
KImageParam Param;
if (!ini.Load(CHAT_FACE_INI_FILE))
return FALSE;
//ini.GetString("Main", "Path", "\\spr\\Ui\\聊天\\表情", szPath, CHAR_BUFFER_LEN);
ini.GetInteger("List", "Count", 0, &nPicCount);
if (nPicCount > MAX_SYSTEM_INLINE_PICTURES)
nPicCount = MAX_SYSTEM_INLINE_PICTURES;
for (i = 0; i < nPicCount; i++)
{
sprintf(szIndex, "Face%d", i + 1);
if (!ini.GetString(szIndex, "Spr", "", szBuffer, CHAR_BUFFER_LEN))
{
_ASSERT(0);
break;
}
IR_InitUiImageRef(CurrentImg);
CurrentImg.nFlipTime = 0;
CurrentImg.nInterval = 0;
CurrentImg.nNumFrames = 0;
strncpy(CurrentImg.szImage, szBuffer, sizeof(CurrentImg.szImage));
CurrentImg.szImage[sizeof(CurrentImg.szImage) - 1] = 0;
CurrentImg.bRenderFlag = RUIMAGE_RENDER_FLAG_REF_SPOT;
CurrentImg.nType = ISI_T_SPR;
memset(&Param, 0, sizeof(Param));
pShell->GetImageParam(CurrentImg.szImage, &Param, CurrentImg.nType);
m_Images.push_back(CurrentImg);
m_ImageParams.push_back(Param);
}
if (FAILED(m_pRepShell->AdviseRepresent(this)))
return FALSE;
if (FAILED(AdviseEngine(this)))
return FALSE;
return TRUE;
}
示例13: LoadScheme
//--------------------------------------------------------------------------
// 功能:载入窗口的界面方案
//--------------------------------------------------------------------------
void KUiSelDlg::LoadScheme(const char* pScheme)
{
char Buff[128];
KIniFile Ini;
sprintf(Buff, "%s\\%s", pScheme, SCHEME_INI_SELDLG);
if (Ini.Load(Buff))
{
KWndImage:: Init(&Ini, "Main");
for (int i = 0; i < KUISEL_MAX_OPTION; i++)
{
sprintf(Buff, "Option_%d", i);
m_OptionBtn[i].Init(&Ini, Buff);
}
m_IlluminateTxt.Init(&Ini, "InfoText");
}
}
示例14: LoadScheme
//--------------------------------------------------------------------------
// 功能:载入窗口的界面方案
//--------------------------------------------------------------------------
void KUiSelServer::LoadScheme(const char* pScheme)
{
char Buff[128];
KIniFile Ini;
sprintf(Buff, "%s\\%s", pScheme, SCHEME_INI_SELSERV);
if (Ini.Load(Buff))
{
KWndShowAnimate::Init(&Ini, "Main");
m_List .Init(&Ini, "List");
m_ScrollBar.Init(&Ini, "Scroll");
m_Login .Init(&Ini, "Login");
m_Cancel .Init(&Ini, "Cancel");
Ini.GetString("Main", "LoginBg", "", m_szLoginBg, sizeof(m_szLoginBg));
}
}
示例15: DefaultScheme
//重新初始化界面
void KUiHeaderControlBar::DefaultScheme(const char* pScheme)
{
char Buff[128];
KIniFile Ini;
if (m_pSelf)
{
sprintf(Buff, "%s\\"SCHEME_INI, pScheme);
if (Ini.Load(Buff))
{
int nValue1, nValue2;
Ini.GetInteger("Main", "Left", 0, &nValue1);
Ini.GetInteger("Main", "Top", 0, &nValue2);
m_pSelf->SetPosition(nValue1, nValue2);
}
}
}