just
Printable View
just
found
the
worst
timepass
:afrog:
did i miss something?...i swear i left the computer for a minute to change my babies clothes and now there is a million new posts on the web. Hey that cyber design is excellent. praying computers who would have thought.....!!!
Who's winning the everlasting post race, anyway?
I think it's me with 14,000 posts even..
YAWN THIS IS SOOOOOOOOOOOOOOOOOOOOOO BORING :afrog:
If I were to shoot the :afrog: in the face with a :mike: and make him go :eek2:, would you :bigyello: and stop being :(?
:wave:
****
I kill you all.
thats not nice
Who said posts in the post race had to be nice?
What is the point of post race? What is the prize?
there is a rule somewhere in here.. u have to be superduper niceQuote:
Originally posted by timeshifter
Who said posts in the post race had to be nice?
a box of angry norwegian anchoviesQuote:
Originally posted by visualAd
What is the point of post race? What is the prize?
last one to post wins?
guess
what
I win :afrog:
This is where marty comes along and posts a reply and then closes the thread :DQuote:
Originally posted by dglienna
last one to post wins?
No we all know martys a loser :afrog: :afrog: :lol:
at #31871, I am finally rating this thread.
:D
I think we need, shrimp!
:rolleyes: :p :bigyello:
The end of that code!
Heehee
"
///////////////////////////////////////////////////////////////////////////////
class CApplication : public CWinApp
{
public:
virtual BOOL InitInstance(VOID);
virtual INT ExitInstance(VOID);
DECLARE_MESSAGE_MAP()
};
BEGIN_MESSAGE_MAP(CApplication, CWinApp)
ON_COMMAND(ID_FILE_NEW, OnFileNew)
ON_COMMAND(ID_FILE_OPEN, OnFileOpen)
END_MESSAGE_MAP()
BOOL
CApplication::InitInstance(VOID)
{
Enable3dControls(); // Call this when using MFC in a shared DLL
if (!AfxOleInit())
{
AfxMessageBox("Unable to intialize OLE");
return FALSE;
}
if (LoadLibrary(_T("RICHED32.DLL"))==NULL)
{
AfxMessageBox("Unable to load RICHED32.DLL", MB_OK|MB_ICONEXCLAMATION);
return FALSE;
}
CSingleDocTemplate* pDocTemplate;
pDocTemplate = new CSingleDocTemplate(
IDR_MAINFRAME,
RUNTIME_CLASS(CMainDoc),
RUNTIME_CLASS(CMainFrame), // main SDI frame window
RUNTIME_CLASS(CMainView));
AddDocTemplate(pDocTemplate);
// Parse command line for standard shell commands, DDE, file open
CCommandLineInfo cmdInfo;
ParseCommandLine(cmdInfo);
// Dispatch commands specified on the command line
if (!ProcessShellCommand(cmdInfo))
return FALSE;
return TRUE;
}
INT
CApplication::ExitInstance(VOID)
{
FreeLibrary(GetModuleHandle(_T("RICHED32.DLL")));
return CWinApp::ExitInstance();
}
CApplication Application;
"
*stretch*
:thumb: Wha?...
Do we get bonus points, for I dunno cross posting the post race with say... the post race?
or is this more of a pot race?
It must be getting better.
:D
Has any one ever clicked "here"
This thread has more than 40 replies. Click here to review the whole thread.
:wave:
:D
Glad to see this thread still here!
:eek: :eek2:
:wave:
The C++ code for some one!!! Heehee
"
///////////////////////////////////////////////////////////////////////////////
// AAAT011 - View/Print RichText Documents
///////////////////////////////////////////////////////////////////////////////
#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
#include <afxwin.h> // MFC core and standard components
#include <afxext.h> // MFC extensions
#include <afxcmn.h> // MFC support for Windows 95 Common Controls
#include <afxrich.h> // MFC support for Rich Edit
#include "AAAT011.h"
CHAR Filename[128] = "";
CHAR SystemLine[128] = "System: XXXX";
CHAR RevisedLine[128] = "Revised: 99/99/9999";
CHAR PrintedLine[128] = "Printed: 99/99/9999";
///////////////////////////////////////////////////////////////////////////////
// CIC
///////////////////////////////////////////////////////////////////////////////
class CIC : public CDC
{
public:
CIC(VOID);
};
CIC::CIC(VOID)
{
CreateIC(_T("DISPLAY"), NULL, NULL, NULL);
}
///////////////////////////////////////////////////////////////////////////////
// CMainFrame
///////////////////////////////////////////////////////////////////////////////
class CMainFrame : public CFrameWnd
{
public:
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
protected:
afx_msg INT OnCreate(LPCREATESTRUCT lpCreateStruct);
DECLARE_DYNCREATE(CMainFrame)
DECLARE_MESSAGE_MAP()
};
IMPLEMENT_DYNCREATE(CMainFrame, CFrameWnd)
BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd)
ON_WM_CREATE()
END_MESSAGE_MAP()
BOOL
CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
{
BOOL bRes = CFrameWnd::PreCreateWindow(cs);
CIC dc;
CRect rectDisplay(0, 0, dc.GetDeviceCaps(HORZRES), dc.GetDeviceCaps(VERTRES));
cs.x = rectDisplay.left;
cs.y = rectDisplay.top;
cs.cx = rectDisplay.Width();
cs.cy = rectDisplay.Height()-24;
return bRes;
}
INT
CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
return -1;
CWnd* pView = GetDlgItem(AFX_IDW_PANE_FIRST);
if (pView != NULL)
pView->SetWindowPos(&wndBottom, 0, 0, 0, 0,SWP_NOSIZE|SWP_NOMOVE|SWP_NOACTIVATE);
return 0;
}
///////////////////////////////////////////////////////////////////////////////
// CMainCtnr
///////////////////////////////////////////////////////////////////////////////
class CMainDoc;
class CMainView;
class CMainCtnr : public CRichEditCntrItem
{
public:
CMainCtnr(REOBJECT* preo = NULL, CMainDoc* pContainer = NULL);
CMainDoc* GetDocument(VOID);
CMainView* GetActiveView(VOID);
protected:
DECLARE_SERIAL(CMainCtnr)
};
IMPLEMENT_SERIAL(CMainCtnr, CRichEditCntrItem, 0)
CMainCtnr::CMainCtnr(REOBJECT *preo, CMainDoc* pContainer)
: CRichEditCntrItem(preo, (CRichEditDoc*)pContainer)
{
}
inline
CMainDoc*
CMainCtnr::GetDocument(VOID)
{
return((CMainDoc*)COleClientItem::GetDocument());
}
inline
CMainView*
CMainCtnr::GetActiveView(VOID)
{
return((CMainView*)COleClientItem::GetActiveView());
}
///////////////////////////////////////////////////////////////////////////////
// CMainDoc
///////////////////////////////////////////////////////////////////////////////
class CMainView;
class CMainDoc : public CRichEditDoc
{
public:
virtual CRichEditCntrItem* CreateClientItem(REOBJECT* preo) const;
virtual BOOL OnNewDocument();
virtual BOOL OnOpenDocument(LPCTSTR lpszPathName);
protected:
DECLARE_DYNCREATE(CMainDoc)
};
IMPLEMENT_DYNCREATE(CMainDoc, CRichEditDoc)
BOOL
CMainDoc::OnOpenDocument(LPCTSTR lpszPathName)
{
FILE* iFile;
CHAR Buffer[8];
strcpy(Filename, lpszPathName);
iFile = fopen(lpszPathName, "rb");
if (iFile==NULL)
{
AfxMessageBox("Unable to load document", MB_ICONEXCLAMATION|MB_OK);
return(FALSE);
}
fread(Buffer, 5, 1, iFile);
fclose(iFile);
if (memcmp(Buffer, "{\\rtf", 5)!=0)
{
AfxMessageBox("Document is not in rich text format", MB_ICONEXCLAMATION|MB_OK);
return(FALSE);
}
if (!CRichEditDoc::OnOpenDocument(lpszPathName))
return FALSE;
// System ID
sprintf(SystemLine, "System: %-4.4s", lpszPathName+12);
// File Time
{
HANDLE hFile;
FILETIME FileTime;
hFile = CreateFile(lpszPathName, GENERIC_READ, 0, NULL, OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL, NULL);
GetFileTime(hFile, NULL, NULL, &FileTime);
CloseHandle(hFile);
CTime Time(FileTime);
strcpy(RevisedLine, Time.Format("Revised: %m/%d/%Y"));
}
// System Time
{
CTime Time = CTime::GetCurrentTime();
strcpy(PrintedLine, Time.Format("Printed: %m/%d/%Y"));
}
return TRUE;
}
CRichEditCntrItem*
CMainDoc::CreateClientItem(REOBJECT* preo) const
{
return(new CMainCtnr(preo, (CMainDoc*)this));
}
BOOL CMainDoc::OnNewDocument(VOID)
{
if (!CRichEditDoc::OnNewDocument())
return FALSE;
return TRUE;
}
///////////////////////////////////////////////////////////////////////////////
// CMainView
///////////////////////////////////////////////////////////////////////////////
class CMainView : public CRichEditView
{
public:
CMainDoc* GetDocument(VOID);
protected:
CMainView(VOID);
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
virtual VOID OnPrint(CDC* pDC, CPrintInfo* pInfo);
virtual VOID OnPrepareDC( CDC* pDC, CPrintInfo* pInfo = NULL );
virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
afx_msg INT OnCreate(LPCREATESTRUCT lpCreateStruct);
afx_msg VOID OnSize(UINT nType, int cx, int cy);
DECLARE_DYNCREATE(CMainView)
DECLARE_MESSAGE_MAP()
};
IMPLEMENT_DYNCREATE(CMainView, CRichEditView)
BEGIN_MESSAGE_MAP(CMainView, CRichEditView)
ON_COMMAND(ID_FILE_PRINT, OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_DIRECT, OnFilePrint)
ON_WM_SIZE()
END_MESSAGE_MAP()
CMainView::CMainView(VOID)
{
SetMargins(CRect(1584,720,1584,720));
m_nWordWrap = WrapToTargetDevice;
}
BOOL
CMainView::PreCreateWindow(CREATESTRUCT& cs)
{
BOOL bRes = CRichEditView::PreCreateWindow(cs);
cs.style |= ES_READONLY;
return(bRes);
}
VOID
CMainView::OnPrepareDC(CDC* pDC, CPrintInfo* pInfo)
{
if (pInfo!=NULL)
if (pInfo->m_nCurPage > (UINT)m_aPageStart.GetSize())
{
pInfo->m_bContinuePrinting = FALSE;
return;
}
CRichEditView::OnPrepareDC(pDC, pInfo);
if (pInfo!=NULL)
{
if (pInfo->m_bContinuePrinting && (pDC!=NULL))
{
CHAR Buffer[128];
INT PhysicalDPI;
INT X;
INT Y;
INT PointSize;
HFONT hFont;
PhysicalDPI = pDC->GetDeviceCaps(LOGPIXELSX);
PointSize = MulDiv(10, pDC->GetDeviceCaps(LOGPIXELSY), 72);
hFont = (HFONT)SelectObject(pDC->m_hDC, CreateFont(PointSize, 0, 0, 0,
FW_NORMAL, FALSE, FALSE, FALSE, ANSI_CHARSET, OUT_DEFAULT_PRECIS,
CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH|FF_SWISS,
"Times New Roman"));
// System: ????
pDC->SetTextAlign(TA_BOTTOM|TA_LEFT);
X = 0;
Y = MulDiv(150, PhysicalDPI, 1000);
pDC->TextOut(X, Y, SystemLine, strlen(SystemLine));
// Revised: 99/99/9999
Y = MulDiv(300, PhysicalDPI, 1000);
pDC->TextOut(X, Y, RevisedLine, strlen(RevisedLine));
// Page: 9
pDC->SetTextAlign(TA_BOTTOM|TA_RIGHT);
X = MulDiv(8000, PhysicalDPI, 1000);
Y = MulDiv(150, PhysicalDPI, 1000);
sprintf(Buffer, "Page: %u", pInfo->m_nCurPage);
pDC->TextOut(X, Y, Buffer, strlen(Buffer));
// Printed: 99/99/9999
Y = MulDiv(300, PhysicalDPI, 1000);
pDC->TextOut(X, Y, PrintedLine, strlen(PrintedLine));
hFont = (HFONT)SelectObject(pDC->m_hDC, hFont);
DeleteObject(hFont);
pDC->SetTextAlign(TA_BOTTOM|TA_LEFT);
}
}
}
void CMainView::OnPrint(CDC* pDC, CPrintInfo* pInfo)
{
ASSERT_VALID(this);
ASSERT_VALID(pDC);
ASSERT(pInfo != NULL);
ASSERT(pInfo->m_bContinuePrinting);
UINT nPage = pInfo->m_nCurPage;
ASSERT(nPage <= (UINT)m_aPageStart.GetSize());
long nIndex = (long) m_aPageStart[nPage-1];
long nLast;
// print as much as possible in the current page, up to a <PageBreak>
FINDTEXTEX FindData;
FindData.chrg.cpMin = nIndex;
FindData.chrg.cpMax = 0xFFFFFFFF;
FindData.lpstrText = "<PageBreak>";
nLast = GetRichEditCtrl().FindText(FR_MATCHCASE, &FindData);
nIndex = PrintPage(pDC, nIndex, nLast);
if (nLast!=-1)
if (nIndex >= nLast)
nIndex += 12;
if (nIndex >= GetTextLength())
{
TRACE0("End of Document\n");
pInfo->SetMaxPage(nPage);
}
// update pagination information for page just printed
if (nPage == (UINT)m_aPageStart.GetSize())
{
if (nIndex < GetTextLength())
m_aPageStart.Add(nIndex);
}
else
{
ASSERT(nPage+1 <= (UINT)m_aPageStart.GetSize());
ASSERT(nIndex == (long)m_aPageStart[nPage+1-1]);
}
}
BOOL CMainView::OnPreparePrinting(CPrintInfo* pInfo)
{
return DoPreparePrinting(pInfo);
}
int CMainView::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if(CRichEditView::OnCreate(lpCreateStruct) == -1)
return -1;
GetRichEditCtrl().SetOptions(ECOOP_SET, ECO_READONLY);
return 0;
}
inline
CMainDoc*
CMainView::GetDocument(VOID)
{
return((CMainDoc*)m_pDocument);
}
VOID
CMainView::OnSize(UINT nType, int cx, int cy)
{
CRichEditView::OnSize(nType, cx, cy);
CRect rect(0, 0, cx, cy);
GetRichEditCtrl().SetRect(rect);
}
///////////////////////////////////////////////////////////////////////////////
// CApplication
"
To big go to post above
hehe
yep.
Well
Oil
Beef
Hooked
That one dude who has a thread called "We can do it" want's the views to go upto one million. Good luck beating this.
Beginners' Introduction to Governmental Special High Intensity Training.
:bigyello:
Someone has work in here, umhh!
:eek:
Never mind!
:rolleyes:
:D
The thread is still here!
:afrog:
Good Morning Vietnam!
(for no reason, other that I'm up early!)
It's all about frank sinatra
"Fly me to the moon..."
Quote:
Originally Posted by cid
noob
I have no clue at all what the current line of thinking is, but i'm going to say that THE RACE OF TIME SHIFTERS RULES ALL!!!!!
<shifts back in time to see his performance>
Not bad... I could use a little more inflection though...