Exemplo n.º 1
0
void CglWnd::loadTextures()
{
	CMzString strAppPath(_MAX_PATH);
	GetWorkPath(strAppPath.C_Str(), strAppPath.GetBufferSize());
	loadAnyTexture(strAppPath + L"\\Data\\0.png", texture[TEXID_SET]);
	loadAnyTexture(strAppPath + L"\\Data\\1.png", texture[TEXID_SET_SELECT]);
}
Exemplo n.º 2
0
BOOL CLogFactory::CreateLogName(BSTR AppName, 
								BSTR Configue, 
								BSTR Section, 
								LONG FileType, 
								CString &strLogName)
{
	CString strError;
	CString strAppPath(AppName);
	CString strFileName(Configue);
	CString strSection(Section);

	if (!IsFileExisted(strAppPath))
	{
		strError.Format(_T("AppName:%s is not existed. CLogFactory::CreateLogName return FALSE."), strAppPath);
		LOGGER_WRITE(strError.GetBuffer());
		LogEvent(strError);
		return FALSE;
	}

	strError.Format(_T("AppName:%s"), strAppPath);
	LOGGER_WRITE(strError.GetBuffer());

	int iIndex = strAppPath.ReverseFind(_T('\\'));
	ATLASSERT(-1 != iIndex);
	strAppPath = strAppPath.Left(iIndex + 1);

	CParameter Parameter;
	CConfigReader Reader;
	Reader.Read(strAppPath, strFileName, strSection, FileType, Parameter);

	CHAR Buffer[MAX_PATH] = { 0 };
#pragma warning(push)
#pragma warning(disable: 4996)
	strcat(Buffer, Parameter.m_cFixFolder);
	strcat(Buffer, Parameter.m_cCycleFolder);
	strcat(Buffer, Parameter.m_cCycleName);
	strcat(Buffer, Parameter.m_cCreateTime);
	strcat(Buffer, Parameter.m_cSaveTime);
	strcat(Buffer, Parameter.m_cExeName);
#pragma warning(pop)
	strLogName = CString(Buffer);
	strLogName.Remove(_T('\\'));
	strLogName.Remove(_T(':'));
	strLogName.Remove(_T('.'));
	strLogName.Remove(_T(' '));

	LOGGER_WRITE2(_T("LogName:") << strLogName.GetBuffer() << _T(" FileType:") << FileType);

	return TRUE;
}
Exemplo n.º 3
0
bool CglWnd::setImageFromDC( HDC dc, int width /*= 480*/, int height /*= 720*/ )
{
	TImage img;
	CMzString strAppPath(_MAX_PATH);
	char strFilePath[_MAX_PATH];
	GetWorkPath(strAppPath.C_Str(), strAppPath.GetBufferSize());
	strAppPath += L"\\Data\\Last.jpg";
	wcstombs(strFilePath, strAppPath.C_Str(), _MAX_PATH);
	if (img.LoadFromDC(dc, 0, 0, width, height))
	{
		img.Bind2DTexture(texture[TEXID_BG]);
		img.SaveJPEG(strFilePath);
		m_imageFileName = strAppPath;
		return true;
	}
	return false;
}
Exemplo n.º 4
0
void glToolbar::init( HWND h )
{
	CMzString strAppPath(_MAX_PATH);
	CMzString strTexPath(_MAX_PATH);
	GetWorkPath(strAppPath.C_Str(), strAppPath.GetBufferSize());

	m_hWnd = h;
	for (int i = 0; i <= 5; i++)
	{
		wsprintf(strTexPath.C_Str(), L"%s\\Data\\btn_%d.png", strAppPath.C_Str(), i);
		loadAnyTexture(strTexPath, texture[TEXID_BUTTONS+i]);
	}
	
	loadAnyTexture(strAppPath + L"\\Data\\dock.png", &m_tbbg);
	for (int i = 0; i < 5; i++)
	{
		m_btns[i].setWnd(m_hWnd,i);
		m_btns[i].setTexture(texture[TEXID_BUTTONS+i]);
	}
	setExpanded(false, 0);
}