本文整理汇总了C++中CCString::upr方法的典型用法代码示例。如果您正苦于以下问题:C++ CCString::upr方法的具体用法?C++ CCString::upr怎么用?C++ CCString::upr使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCString
的用法示例。
在下文中一共展示了CCString::upr方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LoadControl
HRESULT CMixerControl::LoadControl(XMLEl* pLibrary)
{
XMLEl* pThis = 0;
CCString sValues;
PCWSTR wszCurrent = 0;// Current place in the sValues string.
WCHAR* wszToken = 0;// The token. To avoid a buffer-overrun we make this string the same size as sValues.
int i = 0;// Current index we're workin on.
MIXERCONTROLDETAILS_BOOLEAN* pBoolean = (MIXERCONTROLDETAILS_BOOLEAN*)m_pRaw;
MIXERCONTROLDETAILS_UNSIGNED* pUnsigned = (MIXERCONTROLDETAILS_UNSIGNED*)m_pRaw;
MIXERCONTROLDETAILS_SIGNED* pSigned = (MIXERCONTROLDETAILS_SIGNED*)m_pRaw;
if(FAILED(GetNode(0, pLibrary, &pThis, FALSE)))
{
return MIX_E_XMLERR;
}
// Here, we concern ourself with the value attribute.
if(FAILED(XMLGetAttribute(pThis, CCString(L"Values"), &sValues)))
{
SAFE_RELEASE(pThis);
return MIX_E_XMLERR;
}
// Let's go case-insensitive.
sValues.upr();
// If we're doing raw binary data, we can skip all the parsing.
if(m_DataType == MIXDT_CUSTOM)
{
sValues.ToBinary(m_pRaw, m_mc.Metrics.cbCustomData);
SAFE_RELEASE(pThis);
return S_OK;
}
// Set up our looping stuff.
wszCurrent = sValues;
wszToken = (WCHAR*)malloc((wcslen(wszCurrent)+1)*sizeof(WCHAR));
while(1)
{
wszCurrent = NextToken(wszToken, wszCurrent);
if(m_DataType == MIXDT_BOOLEAN)
{
// Now wszToken is the current token.
if(wcsicmp(wszToken, L"TRUE") == 0)
{
pBoolean[i].fValue = TRUE;
}
else if(wcsicmp(wszToken, L"FALSE") == 0)
{
pBoolean[i].fValue = FALSE;
}
}
else if(m_DataType == MIXDT_SIGNED)
{
pSigned[i].lValue = wcstol(wszToken, 0, 10);
}
else if(m_DataType == MIXDT_UNSIGNED)
{
pUnsigned[i].dwValue = wcstoul(wszToken, 0, 10);
}
i++;
if(i >= m_nRawItems) break;
if(wszCurrent == 0) break;
}
free(wszToken);
wszToken = 0;
SAFE_RELEASE(pThis);
// Now commit the buffer.
_CommitRawBuffer();
return S_OK;
}