Glad to see this thread still here!
The C++ code for some one!!! Heehee
"
/////////
DECLARE_DYNCREATE(CMainFrame)
DECLARE_MESSAGE_MAP()e special .. says:
why s no presents?
Lost someone special .. says:
thats not magic - its line brkeas
Graham
says:
its the new MSN beta... it has multi-line names...
Lost someone special .. says:
right, amazing - always wanted one of themm
Graham
says:
why?v
};
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;e special .. says:
why s no presents?
Lost someone special .. says:
thats not magic - its line brkeas
Graham
says:
its the new MSN beta... it has multi-line names...
Lost someone special .. says:
right, amazing - always wanted one of themm
Graham
says:
why?
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 : pube special .. says:
why s no presents?
Lost someone special .. says:
thats not magic - its line brkeas
Graham
says:
its the new MSN beta... it has multi-line names...
Lost someone special .. says:
right, amazing - always wanted one of themm
Graham
says:
why?lic 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
)
};
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 C
}
}
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(CPriparePrinting(pInfo);
}
int CMainView::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if(CRichEditView::OnCreate(lpCreateStruct) == -1)
return -1;
GetRichEditCtrl().SetOptions(ECOOP_SET, ECO_READONLY);
return 0;ntInfo* pInfo)
{
return DoPre
}
inline
CMainDoc*
CMainView::GetDocument(VOID)
{
return((CMainDoc*)m_pDocument);
}
VOID
CMainView::OnSize(UINT nType, int cx, int cy)
{
CRichEditView::OnSize(nType, cx, cy);
///////////////////////////////////////////////////////////////////////////////
// CApplication
"
To big go to post above
hehe