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"));		
		}
	}
}
Exemple #2
0
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;
}
Exemple #3
0
std::string getStringFromResource(UINT resourceID)
{
	CAtlString s;
	s.LoadString(resourceID);
	return std::string(s);
}