本文整理汇总了C++中atl::CString::Format方法的典型用法代码示例。如果您正苦于以下问题:C++ CString::Format方法的具体用法?C++ CString::Format怎么用?C++ CString::Format使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类atl::CString
的用法示例。
在下文中一共展示了CString::Format方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: InitPlugins
///process based init
/// todo - destructor order(I am not sure if it is correct!!)
bool PluginMng::InitPlugins(){
if (plugins_.empty()){
LoadPlugins();
uuiterator vb=plugins_.begin(),ve=plugins_.end();
for (uuiterator i=vb;i!=ve;++i){
uuplugin* p= *i;
CRegKey crk;
long rk=crk.Open(HKEY_LOCAL_MACHINE, _6bees_const::kplugindisabled, KEY_READ|KEY_WRITE);
if (rk==ERROR_SUCCESS){
DWORD i=0;
ATL::CString menuid;
menuid.Format(_T("%d"),p->menuwID_);
if (crk.QueryDWORDValue(menuid,i)==ERROR_SUCCESS){
p->enabled_ = false;
}
}
if (p->enabled_){
p->init();
}else{
disabled_plugins_.push_back(p);
}
}
fillpartswidth();
}
return true;
}
示例2: TimeToString
//////////////////////////////////////////////////////////////////////////
//时间与字符串互相转换函数
ATL::CString GlobeFuns::TimeToString(const CTime &t)
{
ATL::CString strDateTime;
strDateTime.Format("%d-%02d-%02d %02d:%02d:%02d",
t.GetYear(), t.GetMonth(), t.GetDay(),
t.GetHour(), t.GetMinute(), t.GetSecond());
return strDateTime;
}
示例3: TimeToString
HRESULT TimeToString( __time64_t nTime, ATL::CString& strTime )
{
ATL::CTime time(nTime);
strTime.Format( TEXT("%d %d %d %d:%d:%d"),
time.GetYear(), time.GetMonth(),
time.GetDay(), time.GetHour(),
time.GetMinute(),time.GetSecond());
return S_OK;
}
示例4:
PluginMng::~PluginMng(){
for (int i=0;i<(int)plugins_.size();i++){
uuplugin* uup = plugins_.at(i);
CRegKey crk;
long rk=crk.Open(HKEY_LOCAL_MACHINE, _6bees_const::kplugindisabled, KEY_READ|KEY_WRITE);
if (rk==ERROR_SUCCESS){
ATL::CString menuid;
menuid.Format(_T("%d"),uup->menuwID_);
if(uup->enabled_){
crk.DeleteValue(menuid);
}else{
crk.SetDWORDValue(menuid,1);
}
}
}
}
示例5: thread_getalexa
UINT WINAPI alexa::thread_getalexa(LPVOID p){
alexainfo* pas = static_cast<alexainfo*>(p);
int alexarank = 0;
std::wstring hostname(pas->hostname.c_str());
if(url2alexa.find(hostname)==url2alexa.end()){
alexarank = GetAlexaRank(pas->hostname.c_str());
url2alexa[hostname] = alexarank;
}else{
alexarank = url2alexa[hostname];
}
ATL::CString stralexa;
stralexa.Format(L"%d",alexarank);
pas->alexaptr->tid2panetext_[pas->tid] = stralexa;
if(IsWindow(pas->psb->m_hWnd))
pas->psb->SetText(pas->paneid,stralexa);
return 0;
}
示例6: ReadSettingsAndSet
void CSetProxServer::ReadSettingsAndSet(int nFlag = -1)
{
int nType;
TCHAR sUser[256] = {0};
TCHAR sPass[256] = {0};
TCHAR sHost[256] = {0};
int nPort = 80;
int nValidate;
ATL::CString strPort = L"";
CIniFile iniFile(m_strFilePath);
iniFile.GetIntValue(L"proxy", L"type", nType);
if (nFlag == -1)//
{
if (nType == -1)//第一次使用的情况
{
nType = 1;
m_bChanged = TRUE;
}
}
else
{
nType = nFlag;
}
m_ComBoHttp.SetCurSel(nType);
iniFile.GetIntValue(L"proxy", L"validate", nValidate);
if (nValidate == -1)
{
nValidate = 1;//默认情况下是需要验证的
}
iniFile.GetStrValue(L"proxy", L"host", sHost, sizeof(sHost));
iniFile.GetIntValue(L"proxy", L"port", nPort);
iniFile.GetStrValue(L"proxy", L"user", sUser, sizeof(sUser));
iniFile.GetStrValue(L"proxy", L"password", sPass, sizeof(sPass));
HWND hWndVerify = ::GetDlgItem(GetViewHWND(), IDC_COMBO_PROX_SERVER_VERIFY);
HWND hWndAddr = ::GetDlgItem(GetViewHWND(), IDC_EDITBOX_PROX_SERVER_ADDR);
HWND hWndPort = ::GetDlgItem(GetViewHWND(), IDC_EDITBOX_PROX_SERVER_PORT);
HWND hWndAccount = ::GetDlgItem(GetViewHWND(), IDC_EDITBOX_PROX_SERVER_ACCOUNT);
HWND hWndPass = ::GetDlgItem(GetViewHWND(), IDC_EDITBOX_PROX_SERVER_PASS);
if (nType == 0)//不使用的情况
{
::EnableWindow(hWndVerify, FALSE);
::EnableWindow(hWndAddr, FALSE);
::EnableWindow(hWndPort, FALSE);
::EnableWindow(hWndAccount, FALSE);
::EnableWindow(hWndPass, FALSE);
ReSet();
}
else
{
if (nPort == -1)
{
if (nType == 1)
nPort = 80;
else if (nType == 2)
nPort = 1080;
}
strPort.Format(L"%d", nPort);
::EnableWindow(hWndVerify, TRUE);
::EnableWindow(hWndAddr, TRUE);
::EnableWindow(hWndPort, TRUE);
::EnableWindow(hWndAccount, nValidate);
::EnableWindow(hWndPass, nValidate);
if (nValidate <= 0)//不需要验证的时候
{
memset(sUser, 0, sizeof(sUser));
memset(sPass, 0, sizeof(sUser));
}
m_ComBoVerify.SetCurSel(nValidate);
m_wndEditAddr.SetWindowText(sHost);
m_wndEditPort.SetWindowText(strPort);
m_wndEditAccount.SetWindowText(sUser);
m_wndEditPass.SetWindowText(sPass);
}
return;
}