当前位置: 首页>>代码示例>>C++>>正文


C++ CAtlString类代码示例

本文整理汇总了C++中CAtlString的典型用法代码示例。如果您正苦于以下问题:C++ CAtlString类的具体用法?C++ CAtlString怎么用?C++ CAtlString使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了CAtlString类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: LogPath

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"));		
		}
	}
}
开发者ID:UIKit0,项目名称:IISxpress,代码行数:31,代码来源:IISxpressHttpModule.cpp

示例2: GetErrorDescription

CAtlString GetErrorDescription(HRESULT hr)
{

	CAtlString aStr;
	aStr.Format("HRESULT=0x%x; ErrorString=%s; Description=%s", hr, DXGetErrorString8(hr), DXGetErrorDescription8(hr));
	return aStr; 
}
开发者ID:codeboost,项目名称:libertv,代码行数:7,代码来源:FMPlayerDShow.cpp

示例3: hEventRun

int Runner::NewCmd(LPCTSTR taskname, LPTSTR lpCmdLine)
{
	Params::Save(lpCmdLine);

	DWORD dwProcessId = ::GetCurrentProcessId();
    CHandle hEventRun( ::CreateEvent( NULL, FALSE, TRUE, c_szEventRun));
	if (::WaitForSingleObject(hEventRun, c_dwRunTimeout) != WAIT_OBJECT_0)
		return ecSimultanius;

	CString strEvent;
	strEvent.Format(c_szEventExit, dwProcessId);
	CHandle hEventExit( ::CreateEvent( NULL, TRUE, FALSE, strEvent));
	::ResetEvent( hEventExit);

    CAtlString sApp;
	sApp.Format(_T("schtasks /run /TN \"%s\""), taskname);

    STARTUPINFO startup_info = {0};
    startup_info.cb = sizeof( STARTUPINFO );
    PROCESS_INFORMATION process_info = {0};

    BOOL bStatus = ::CreateProcess( NULL, sApp.GetBuffer(MAX_PATH), NULL, NULL, FALSE, CREATE_NO_WINDOW, NULL, NULL, &startup_info, &process_info );
    if ( bStatus == FALSE)
        return ecRunTask;
    ::CloseHandle( process_info.hProcess );
    ::CloseHandle( process_info.hThread );

	if (::WaitForSingleObject(hEventRun, c_dwRunTimeout) != WAIT_OBJECT_0)
		return ecUnknown;

    ::WaitForSingleObject(hEventExit, INFINITE);

    return ecNoError;
}
开发者ID:ki0ki0,项目名称:sudoWin,代码行数:34,代码来源:Runner.cpp

示例4: Desc

	std::wstring Desc() const
	{
		CAtlString s;
		s.Format(L"<TCP PID:%d Local:(%s:%d) Remote:(%s:%d), State:%d>",
			dwOwningPid, Local().c_str(), dwLocalPort, Remote().c_str(), dwRemotePort, dwState);
		return (LPCTSTR)s;
	}
开发者ID:bahamut8348,项目名称:xkcode,代码行数:7,代码来源:pyPort.cpp

示例5: CFIocpCopyFileTask

void CFilePage::OnBnClickedBtnIocpTest()
{
    //BOOL bRet = FALSE;
    BOOL bRet = FALSE;

    //CFIocpFileReadTask  fileReadTask;
    //API_VERIFY(fileReadTask.Create(TEXT("D:\\test.jpg"), 
    //    GENERIC_WRITE | GENERIC_READ, 
    //    FILE_SHARE_READ, NULL,
    //    OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_OVERLAPPED));

    CFElapseCounter counter;
    for (INT i = 0; i < m_nCopyFileCount; i++)
    {
        CFIocpCopyFileTask* pFileCopyTask = new CFIocpCopyFileTask(&m_iocpMgr);
        CAtlString strTagetFile;
        strTagetFile.Format(TEXT("E:\\TargetCopy_%d.txt"), counter.GetElapseTime() % LONG_MAX);
        pFileCopyTask->OpenFiles(m_strCopySrcFile, strTagetFile);
        m_iocpMgr.AssociateTask(pFileCopyTask, TRUE);
    }


    //fileIocpTask.m_OverLapped.overLapped.Offset = 0;

    //fileIocpTask.WriteFileHeader((LPOVERLAPPED)&fileIocpTask.m_OverLapped);

    //fileReadTask.Close();

    //iocpMgr.Stop();
    //iocpMgr.Close();
}
开发者ID:moon-sky,项目名称:fishjam-template-library,代码行数:31,代码来源:FilePage.cpp

示例6: LoadString

std::wstring Helpers::LoadString(UINT uID)
{
	CAtlString localized;

	if(localized.LoadStringW(uID))
		return std::wstring(localized);
	else
		return std::wstring(L"LoadString failed");
}
开发者ID:MussaratAziz,项目名称:console,代码行数:9,代码来源:Helpers.cpp

示例7: 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());
}
开发者ID:kaina,项目名称:sandbox,代码行数:11,代码来源:chatLog.cpp

示例8: MakeVariantNotArray

/*
 * Converts the specified (sub-)string into a Variant value.
 */
CComVariant CMELCommand::MakeVariantNotArray(const CAtlString& strText)
{
	CComVariant variant(strText);
	if (strText.SpanExcluding(L"0123456789.-+e").IsEmpty()) {
		if (strText.Find(L".") < 0) {
			variant.ChangeType(VT_I4);
		} else {
			variant.ChangeType(VT_R8);
		}
	}
	return variant;
}
开发者ID:BigRoy,项目名称:Maya-devkit,代码行数:15,代码来源:MELCommand.cpp

示例9: AddDialogToTree

HTREEITEM DlgSettingsMain::AddDialogToTree(const UINT id, const std::shared_ptr<DlgSettingsBase>& newDlg, CRect& rect, HTREEITEM htiParent /*= NULL*/)
{
	newDlg->Create(m_hWnd, rect);
	newDlg->SetWindowPos(HWND_TOP, rect.left, rect.top, 0, 0, SWP_NOSIZE);

	CAtlString strName;
	strName.LoadString (id);
	HTREEITEM hItem = m_treeCtrl.InsertItem(strName, htiParent, NULL);

	if (hItem != NULL) m_settingsDlgMap.insert(SettingsDlgsMap::value_type(hItem, newDlg));

	return hItem;
}
开发者ID:Ashod,项目名称:Console2,代码行数:13,代码来源:DlgSettingsMain.cpp

示例10: debugout

	virtual void debugout(TCHAR* format, ...)
	{
		CAtlString ds;
		va_list ap;

		va_start(ap, format);
		ds.FormatV(format, ap);
		va_end(ap);

		if (_out_type == DEBUGOUT_STRING)
			_output_string(ds);
		else if (_out_type == DEBUGOUT_FILE)
			_output_file(ds);
	}
开发者ID:kaina,项目名称:sandbox,代码行数:14,代码来源:debugout.hpp

示例11: LoadAtlString

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);
}
开发者ID:Essjay1,项目名称:Windows-classic-samples,代码行数:50,代码来源:tedtransformdialog.cpp

示例12: CAtlString

bool CIISxpressHttpModule::GetAppPoolName(IHttpContext* pHttpContext, CAtlString& name)
{
	bool status = false;

	if (m_pHttpServer != NULL)
	{
		LPCWSTR pszAppPoolName = m_pHttpServer->GetAppPoolName();
		if (pszAppPoolName != NULL)
		{
			name = CAtlString(pszAppPoolName);
			status = true;
		}
	}

	// if we didn't get the application pool name from the server then at least try and fall back to the application id
	if (!status && pHttpContext != NULL)
	{
		IHttpApplication* pApp = pHttpContext->GetApplication();
		if (pApp != NULL)
		{
			PCWSTR pszAppId = pApp->GetApplicationId();
			if (pszAppId != NULL)
			{
				name = CAtlString(pszAppId);
				name.Replace('/', '_');
				status = true;
			}
		}
	}
	
	return status;
}
开发者ID:UIKit0,项目名称:IISxpress,代码行数:32,代码来源:IISxpressHttpModule.cpp

示例13: SplitString

size_t Misc::SplitString(const CString & str, LPCTSTR tokens, CAtlList<CString> & list)
{
  list.RemoveAll();
  CAtlString token;
  int curPos = 0;

  token = str.Tokenize(tokens, curPos);
  while (-1 != curPos)
  {
    if (!token.IsEmpty())
    {
      list.AddTail(token);
    }
    token = str.Tokenize(tokens, curPos);
  }
  return list.GetCount();
}
开发者ID:salsita,项目名称:Magpie,代码行数:17,代码来源:Misc.cpp

示例14:

HRESULT CIIS7XMLConfigHelper::GetSiteNode(IXMLDOMDocument* pDoc, LPCWSTR pszId, IXMLDOMNode** ppSite)
{
	if (pDoc == NULL || pszId == NULL || ppSite == NULL)
		return E_POINTER;

	// we want the site corresponding to the instance string
	CAtlString sSitesQuery;
	sSitesQuery.Format(_T("/configuration/system.applicationHost/sites/site[@id='%ls']"), pszId);

	CComPtr<IXMLDOMNode> pSite;
	HRESULT hr = pDoc->selectSingleNode(CComBSTR(sSitesQuery), &pSite);
	if (hr != S_OK)
		return hr;
		
	if (pSite == NULL)
		return E_FAIL;

	return pSite.CopyTo(ppSite);
}
开发者ID:UIKit0,项目名称:IISxpress,代码行数:19,代码来源:IIS7XMLConfigHelper.cpp

示例15: CheckReadPerissions

CAtlString RegValue::GetString(LPCTSTR lpValue)
{
	CheckReadPerissions();

	DWORD dLen;
	DWORD dwType;
	m_stResult = ::RegQueryValueEx( (HKEY)m_hKey.m_h, lpValue, 0, &dwType, NULL, &dLen);
    CheckError("Can't query registry value");

	if (dwType != REG_SZ)
		throw std::runtime_error("Incompatible types");

    CAtlString str;
	m_stResult = ::RegQueryValueEx( (HKEY)m_hKey.m_h, lpValue, 0, NULL,
		(LPBYTE)str.GetBuffer(dLen / sizeof(TCHAR) + 1), &dLen);
    CheckError("Can't query registry value");

    str.ReleaseBuffer(dLen / sizeof(TCHAR));
	str.ReleaseBuffer();
	return str;
}
开发者ID:ki0ki0,项目名称:sudoWin,代码行数:21,代码来源:RegValue.cpp


注:本文中的CAtlString类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。