本文整理汇总了C++中CCString::FormatW方法的典型用法代码示例。如果您正苦于以下问题:C++ CCString::FormatW方法的具体用法?C++ CCString::FormatW怎么用?C++ CCString::FormatW使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCString
的用法示例。
在下文中一共展示了CCString::FormatW方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Encode
/*
010515 Carl Corcoran
chKey is the $ or % or whatever that will be inserted.
wszChars is a string that contains all the characters to be encoded.
String="The"
Encode(L'$', L"he");
Yields: T$68$65
*/
void CCString::Encode(WCHAR chKey, PCWSTR wszChars)
{
CCString r = "";// Resulting string
CCString t = "";
PWSTR wszSrcThis = this->wszString;
PCWSTR wszSrcChars = wszChars;
WCHAR ch;
while(1)
{
ch = wszSrcThis[0];
if(ch == 0) break;
wszSrcChars = wszChars;
if(wcschr(wszChars, ch) != 0)
{
t.FormatW(L"%c%02.2x", chKey, ch);
r += t;
}
else
{
r += ch;
}
wszSrcThis ++;
}
this->_CreateFromW(r);
}
示例2: _odsf
void _odsf(PCWSTR wszFunction, PCWSTR wszString, va_list argptr)
{
CCString s;
CCString s2;
s.FormatW(L"[ %-20.20s ] %s", wszFunction, wszString);
s2.FormatvW(s, argptr);
OutputDebugStringW(s2);
OutputDebugStringW(L"\n");
return;
}
示例3: _odsf
void _odsf(PCWSTR wszFunction, PCWSTR wszString)
{
CCString sMsg;
sMsg.FormatW(L"[ %-20.20s ] ", wszFunction);
sMsg.cat(wszString);
if(__g_bLogOpened == TRUE)
{
__g_Log._AddEntry(sMsg);
}
OutputDebugStringW(sMsg);
OutputDebugStringW(L"\n");
}
示例4: SaveControl
HRESULT CMixerControl::SaveControl(XMLDoc* pDoc, XMLEl* pParent)
{
XMLEl* pThis = 0;
HRESULT hr;
CCString sValues;
CCString sTemp;
BOOL bFirst;
if(FAILED(hr = XMLFindControl(pDoc, pParent,
m_mc.dwControlID, CCString(m_mc.szName), m_Type, &pThis, TRUE)))
{
return hr;
}
// Save the values of this control.
// We just go in order, separating values with a comma.
bFirst = TRUE;// This will determine if we need to add a comma or not.
int i = 0;
switch(m_DataType)
{
case MIXDT_CUSTOM:
{
sValues.FromBinary(m_pRaw, m_mc.Metrics.cbCustomData);
pThis->setAttribute(CCString(L"Values"), sValues.variant());
break;
}
case MIXDT_SIGNED:
{
MIXERCONTROLDETAILS_SIGNED* p = (MIXERCONTROLDETAILS_SIGNED*)m_pRaw;
sValues.froml(p[0].lValue, 10);
for(i=1;i<m_nRawItems;i++)
{
sValues.cat(L", ");
sTemp.froml(p[i].lValue, 10);
sValues.cat(sTemp);
}
pThis->setAttribute(CCString(L"Values"), sValues.variant());
break;
}
case MIXDT_UNSIGNED:
{
MIXERCONTROLDETAILS_UNSIGNED* p = (MIXERCONTROLDETAILS_UNSIGNED*)m_pRaw;
sValues.fromul(p[0].dwValue, 10);
for(i=1;i<m_nRawItems;i++)
{
sValues.cat(L", ");
sTemp.fromul(p[i].dwValue, 10);
sValues.cat(sTemp);
}
pThis->setAttribute(CCString(L"Values"), sValues.variant());
break;
}
case MIXDT_BOOLEAN:
{
MIXERCONTROLDETAILS_BOOLEAN* p = (MIXERCONTROLDETAILS_BOOLEAN*)m_pRaw;
sValues = (p[0].fValue == TRUE) ? L"TRUE" : L"FALSE";
for(i=1;i<m_nRawItems;i++)
{
sTemp.FormatW(L", %s", (p[i].fValue == TRUE) ? L"TRUE" : L"FALSE");
sValues.cat(sTemp);
}
pThis->setAttribute(CCString(L"Values"), sValues.variant());
break;
}
default:
{
//
}
}
SAFE_RELEASE(pThis);
return hr;
}