[ Pobierz całość w formacie PDF ]
.CFontDialog dlg(slfCopy);dlg.m_cf.Flags |= CF_FORCEFONTEXIST | CF FIKEDPITCHONLY;// Jeœli u¿ytkownik wybierze czcionkê, utworzymy j¹// i umieœcimy w zmiennej sk³adowej do póŸniejszego// u¿ytku.if (dlg.DoModal() == IDOK) {CFont* pFontCopy = new CFont;if (pFontCopy->CreateFont!ndirect(&lfCopy)){m_nPointSize = dlg.GetSize(); if (m_pFont != NULL) delete m_pFont;m_pFont = pFontCopy;memcpy(&m_logfont, SlfCopy, sizeof(IfCopy) ) , Invalidate();}else{delete pFontCopy; MessageBox(_T("Nie powiod³o siê stworzenie nowej czcionki!"));}}}//HexViewDoc.cpp : implementation of the CHexViewDoc class///////////////////////////////////////////////////////CHexViewDoc comandsBOOL CHexViewDoc::OnOpenDocument(LPCTSTR IpszPathName){if (ICDocument::OnOpenDocument(IpszPathName)) return FALSE;if (m_pFile != NULL){m_pFile->Close(); delete m_pFile;}try{m_pFile =new CFile(IpszPathName, CFile::modeRead | CFile::typeBinary);}catch (CFileException* e){ CString strError;strError.Format(_T("Nie powiod³o siê otwarcie pliku: %d'_sys_errlist[e->m_10sError]); AfxMessageBox(strError); return FALSE;}m_1FileSize = m_pFile->GetLength( return TRUE;}/////////////////////////////// CHexViewDoc implementationBOOL CHexViewDoc::ReadLine(CString& strLine, int nLength,LONG lOffset = -1L){LONG IPosition;if (lOffset != -1L)1Position = m_pFile->Seek(lOffset, CFile::begin); else1Position = m_pFile->GetPosition();if (1Position == -1L){TRACE2("CHexViewDoc::ReadLine zwróci³o" " FALSE Seek(%8.81X, %8.81X)\n", lOffset, IPosition); return FALSE;BYTE* pszBuffer = new BYTE [nLength] ;int nReturned = m_pFile->Read (pszBuffer, nLength);if (nReturned
[ Pobierz całość w formacie PDF ]