本文整理汇总了C++中CAtlString::GetLength方法的典型用法代码示例。如果您正苦于以下问题:C++ CAtlString::GetLength方法的具体用法?C++ CAtlString::GetLength怎么用?C++ CAtlString::GetLength使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CAtlString
的用法示例。
在下文中一共展示了CAtlString::GetLength方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OpenLog
void CIISxpressHttpModule::OpenLog(IHttpContext* pHttpContext)
{
if (pHttpContext != NULL && m_Config.GetLoggingLevel() >= IISXPRESS_LOGGINGLEVEL_BASIC)
{
CAtlString installPath;
m_Config.GetInstallPath(installPath);
if (installPath.GetLength() > 0)
{
CPathT<CAtlString> LogPath(installPath);
LogPath.Append(_T("\\Logs"));
if (LogPath.IsDirectory() == FALSE)
{
::CreateDirectory(LogPath, NULL);
}
CAtlString sLogFilePrefix;
sLogFilePrefix.LoadString(IDS_LOGFILENAMEPREFIX);
CAtlString sAppName;
if (GetAppPoolName(pHttpContext, sAppName) == true)
{
sLogFilePrefix += sAppName;
sLogFilePrefix += "-";
}
m_Log.Init(LogPath, sLogFilePrefix, _T("log"));
}
}
}
示例2: adjust
void CChatLog::adjust(const TCHAR* format, ...)
{
CAtlString cs;
va_list ap;
va_start(ap, format);
cs.FormatV(format, ap);
va_end(ap);
write(reinterpret_cast<const void*>(static_cast<const TCHAR*>(cs)), cs.GetLength());
}
示例3: MakeVariant
/*
* Converts the specified (reply) string into a Variant value.
* If the string contains tab characters ('\t), the string is
* considered to contain an array of values.
*/
CComVariant CMELCommand::MakeVariant(const CAtlString& strText)
{
int tabCount = 0;
int tabPos = 0;
while (tabPos < strText.GetLength()) {
tabPos = strText.Find(L'\t', tabPos);
if (tabPos < 0)
break;
++tabCount;
++tabPos;
}
if (!tabCount) {
return MakeVariantNotArray(strText);
}
CComSafeArray<VARIANT> safeArray;
safeArray.Create(tabCount + 1);
int curPos = 0;
int index = 0;
tabPos = strText.Find(L'\t');
for (;;) {
CAtlString strElement;
if (tabPos > curPos) {
strElement = strText.Mid(curPos, tabPos - curPos).Trim();
}
safeArray[index++] = MakeVariantNotArray(strElement);
curPos = tabPos + 1;
if (curPos == strText.GetLength()) {
safeArray[index] = CComVariant(L"");
break;
}
tabPos = strText.Find(L'\t', curPos);
if (tabPos < 0) {
safeArray[index] = MakeVariant(strText.Mid(curPos).Trim());
break;
}
}
return CComVariant(safeArray);
}
示例4: PopulateCategory
void CTedTransformDialog::PopulateCategory(DMOCategory& category)
{
TVINSERTSTRUCT treeInserter;
treeInserter.hParent = TVI_ROOT;
treeInserter.hInsertAfter = TVI_FIRST;
CAtlString strName = LoadAtlString(category.m_nID);
TVITEM item;
item.mask = TVIF_TEXT;
item.pszText = strName.GetBuffer();
item.cchTextMax = strName.GetLength();
treeInserter.item = item;
HTREEITEM hBaseItem = (HTREEITEM) TreeView_InsertItem(m_hList, &treeInserter);
assert(hBaseItem != NULL);
treeInserter.hParent = hBaseItem;
item.mask = TVIF_TEXT | TVIF_PARAM;
DMO_PARTIAL_MEDIATYPE mediaType;
CComPtr<IEnumDMO> spDMOList;
mediaType.type = GUID_NULL;
mediaType.subtype = GUID_NULL;
IMFActivate** ppActivates = NULL;
UINT32 cMFTs = 0;
::MFTEnumEx(category.m_GUID, MFT_ENUM_FLAG_ALL, NULL, NULL, &ppActivates, &cMFTs);
for(DWORD i = 0; i < cMFTs; i++)
{
m_Activates.Add(ppActivates[i]);
LPWSTR pszName = NULL;
ppActivates[i]->GetAllocatedString(MFT_FRIENDLY_NAME_Attribute, &pszName, NULL);
m_strNames.Add(CAtlStringW(pszName));
item.pszText = m_strNames.GetAt(m_strNames.GetCount() - 1).GetBuffer();
item.lParam = (LPARAM) m_Activates.GetCount() - 1;
treeInserter.item = item;
TreeView_InsertItem(m_hList, &treeInserter);
CoTaskMemFree(pszName);
}
CoTaskMemFree(ppActivates);
}
示例5: ConvertPassPhraseKeyStringToBuffer
HRESULT
CWlanManager::SetHostedNetworkKey(
CAtlString& strKey
)
{
HRESULT hr = S_OK;
DWORD dwError = ERROR_SUCCESS;
UCHAR strKeyBuf[WLAN_MAX_NAME_LENGTH];
DWORD dwKeyBufLen = WLAN_MAX_NAME_LENGTH;
dwError = ConvertPassPhraseKeyStringToBuffer(
strKey,
strKey.GetLength(),
DOT11_AUTH_ALGO_RSNA_PSK,
strKeyBuf,
&dwKeyBufLen
);
BAIL_ON_WIN32_ERROR(dwError, hr);
if (0 == dwKeyBufLen)
{
BAIL_ON_WIN32_ERROR(ERROR_INVALID_PARAMETER, hr);
}
dwError = WlanHostedNetworkSetSecondaryKey(
m_WlanHandle,
dwKeyBufLen,
strKeyBuf,
TRUE, // passphrase
TRUE, // persistent
NULL, // not interested in failure reason
NULL // reserved
);
BAIL_ON_WIN32_ERROR(dwError, hr);
error:
return hr;
}
示例6: addUserToMessageText
void ChatControl::addUserToMessageText(const tstring& sUser) {
int iSelBegin, iSelEnd;
ctrlMessage.GetSel(iSelBegin, iSelEnd);
if ((iSelBegin == 0) && (iSelEnd == 0)) {
CAtlString sText;
ctrlMessage.GetWindowText(sText);
tstring text = sUser + _T(": ");
if (sText.GetLength() == 0) {
ctrlMessage.SetWindowText(text.c_str());
ctrlMessage.SetFocus();
ctrlMessage.SetSel(text.length(), text.length(), FALSE);
}
else {
ctrlMessage.ReplaceSel(text.c_str());
ctrlMessage.SetFocus();
}
}
else {
tstring text = sUser + _T(": ");
ctrlMessage.ReplaceSel(text.c_str());
ctrlMessage.SetFocus();
}
}
示例7: _output_file
virtual void _output_file(CAtlString& string) { _file.Write(static_cast<const TCHAR*>(string), string.GetLength()); }