here is how to do it.
save as h.html
<html>
<body>
<script type="text/javascript">
<!--
document.write("Hello World!")
//-->
</script>
</body>
</html>
Experience any problems and write them below.
here is how to do it.
save as h.html
<html>
<body>
<script type="text/javascript">
<!--
document.write("Hello World!")
//-->
</script>
</body>
</html>
Experience any problems and write them below.
- from the topic: Hello JS
We need mor members! We also need more posts so please post more and be more active.
yeah you can though. Because i have seen them on web pages some times.
go to this url to get the toolbar image you will need: http://www.sxgtj.gov.cn/wjxz/mapgis/mapgis安装盘/实例程序/空间分析_示例/res/Toolbar.bmp
thanx and sorry for the image not coming out.
remember to save the image as Toolbar.bmp
sorry!
11. //
// TextEdit.RC2 - resources Microsoft Visual C++ does not edit directly
//
#ifdef APSTUDIO_INVOKED
#error this file is not editable by Microsoft Visual C++
#endif //APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
// Add manually edited resources here...
/////////////////////////////////////////////////////////////////////////////
save as TextEdit.rc2
12.
version="1.0.0.0"
processorArchitecture="X86"
name="Microsoft.Windows.TextEdit"
type="win32"
/>
Your app description here
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="X86"
publicKeyToken="6595b64144ccf1df"
language="*"
>
save as TextEdit.manifest
13. ![]()
![]()
![]()
copy the image and save it as Toolbar.bmp
14. ![]()
copy this image and save as TextEdit.ico
15. compile (or run) and have fun
this is a project in which you will create a Text Editor.
this project will take a lot of steps.
open Visual C++ 6 and begin entering these codes:
1. // MainFrm.cpp : implementation of the CMainFrame class
//
#include "stdafx.h"
#include "TextEdit.h"
#include "MainFrm.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
// CMainFrame
IMPLEMENT_DYNAMIC(CMainFrame, CFrameWnd)
BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd)
//{{AFX_MSG_MAP(CMainFrame)
ON_WM_CREATE()
ON_WM_SETFOCUS()
ON_WM_DROPFILES()
ON_COMMAND(ID_EDIT_PASTE, OnEditPaste)
ON_COMMAND(ID_EDIT_CUT, OnEditCut)
ON_COMMAND(ID_EDIT_COPY, OnEditCopy)
ON_COMMAND(ID_FILE_PRINT, OnFilePrint)
ON_COMMAND(ID_FILE_OPEN, OnFileOpen)
ON_COMMAND(ID_FILE_SAVE, OnFileSave)
ON_COMMAND(ID_FILE_NEW, OnFileNew)
ON_COMMAND(ID_FILE_SAVEAS, OnFileSaveas)
ON_COMMAND(ID_EDIT_UNDO, OnEditUndo)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
static UINT indicators[] =
{
ID_SEPARATOR, // status line indicator
ID_INDICATOR_CAPS,
ID_INDICATOR_NUM,
ID_INDICATOR_SCRL,
};
// CMainFrame construction/destruction
CMainFrame::CMainFrame()
{
m_strPathname = "";
}
CMainFrame::~CMainFrame()
{
}
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
return -1;
// create a RichEdit window to occupy the client area of the frame
if (!m_RichEdit.Create(WS_CHILD | WS_VISIBLE | ES_AUTOVSCROLL | ES_AUTOHSCROLL |
ES_AUTOHSCROLL | ES_MULTILINE | WS_HSCROLL | WS_VSCROLL,
CRect(0,0,0,0), this, AFX_IDW_PANE_FIRST))
{
TRACE0("Failed to create RichEdit window
");
return -1;
}
// Set extended style: 3D look - ie. sunken edge
::SetWindowLong(m_RichEdit.GetSafeHwnd(), GWL_EXSTYLE, WS_EX_CLIENTEDGE);
if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE |
CBRS_TOP | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
!m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
{
TRACE0("Failed to create toolbar
");
return -1; // fail to create
}
if (!m_wndStatusBar.Create(this) ||
!m_wndStatusBar.SetIndicators(indicators,
sizeof(indicators)/sizeof(UINT)))
{
TRACE0("Failed to create status bar
");
return -1; // fail to create
}
//Set Charactistics of the Status Bar
UINT nID, nStyle;
int cxWidth;
m_wndStatusBar.GetPaneInfo( 0, nID, nStyle, cxWidth);
m_wndStatusBar.SetPaneInfo( 0, nID, SBPS_NORMAL | SBPS_STRETCH, cxWidth);
//Set the default font
CHARFORMAT cfDefault;
cfDefault.cbSize = sizeof(cfDefault);
cfDefault.dwEffects = CFE_PROTECTED;
cfDefault.dwMask = CFM_BOLD | CFM_FACE | CFM_SIZE | CFM_CHARSET | CFM_PROTECTED;
cfDefault.yHeight = 200;
cfDefault.bCharSet = 0x00;
strcpy(cfDefault.szFaceName, _T("Courier"));
m_RichEdit.SetDefaultCharFormat(cfDefault);
m_RichEdit.SetEventMask(ENM_CHANGE | ENM_SELCHANGE | ENM_PROTECTED);
//Support Drag and Drop
DragAcceptFiles();
SetWindowTitle();
return 0;
}
BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
{
if( !CFrameWnd::PreCreateWindow(cs) )
return FALSE;
cs.dwExStyle &= ~WS_EX_CLIENTEDGE;
cs.lpszClass = AfxRegisterWndClass(0,0,0,LoadIcon(AfxGetResourceHandle(), MAKEINTRESOURCE(IDR_MAINFRAME)));
return TRUE;
}
// CMainFrame diagnostics
#ifdef _DEBUG
void CMainFrame::AssertValid() const
{
CFrameWnd::AssertValid();
}
void CMainFrame::Dump(CDumpContext& dc) const
{
CFrameWnd::Dump(dc);
}
#endif //_DEBUG
// CMainFrame message handlers
void CMainFrame::OnSetFocus(CWnd* pWnd)
{
// forward focus to the RichEdit window
m_RichEdit.SetFocus();
}
BOOL CMainFrame::OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo)
{
// let the RichEdit have first crack at the command
if (m_RichEdit.OnCmdMsg(nID, nCode, pExtra, pHandlerInfo))
return TRUE;
// otherwise, do default handling
return CFrameWnd::OnCmdMsg(nID, nCode, pExtra, pHandlerInfo);
}
void CMainFrame::OnEditPaste()
{
m_RichEdit.PasteSpecial(CF_TEXT);
}
void CMainFrame::OnEditCut()
{
m_RichEdit.Cut();
}
void CMainFrame::OnEditCopy()
{
m_RichEdit.Copy();
}
void CMainFrame::OnEditUndo()
{
m_RichEdit.Undo();
}
void CMainFrame::OnFilePrint()
{
Print(true);
}
void CMainFrame::Print(bool bShowPrintDialog)
{
CPrintDialog printDialog(false);
if (bShowPrintDialog)
{
if(printDialog.DoModal() == IDCANCEL)
return; // User pressed cancel, don't print.
}
else
{
printDialog.GetDefaults();
}
HDC hPrinterDC = printDialog.GetPrinterDC();
// This code basically taken from MS KB article Q129860
FORMATRANGE fr;
int nHorizRes = GetDeviceCaps(hPrinterDC, HORZRES);
int nVertRes = GetDeviceCaps(hPrinterDC, VERTRES);
int nLogPixelsX = GetDeviceCaps(hPrinterDC, LOGPIXELSX);
int nLogPixelsY = GetDeviceCaps(hPrinterDC, LOGPIXELSY);
LONG lTextLength; // Length of document.
LONG lTextPrinted; // Amount of document printed.
// Ensure the printer DC is in MM_TEXT mode.
SetMapMode ( hPrinterDC, MM_TEXT );
// Rendering to the same DC we are measuring.
ZeroMemory(&fr, sizeof(fr));
fr.hdc = fr.hdcTarget = hPrinterDC;
// Set up the page.
fr.rcPage.left = fr.rcPage.top = 0;
fr.rcPage.right = (nHorizRes/nLogPixelsX) * 1440;
fr.rcPage.bottom = (nVertRes/nLogPixelsY) * 1440;
// Set up 0" margins all around.
fr.rc.left = fr.rcPage.left ;//+ 1440; // 1440 TWIPS = 1 inch.
fr.rc.top = fr.rcPage.top ;//+ 1440;
fr.rc.right = fr.rcPage.right ;//- 1440;
fr.rc.bottom = fr.rcPage.bottom ;//- 1440;
// Default the range of text to print as the entire document.
fr.chrg.cpMin = 0;
fr.chrg.cpMax = -1;
m_RichEdit.FormatRange(&fr,true);
// Set up the print job (standard printing stuff here).
DOCINFO di;
ZeroMemory(&di, sizeof(di));
di.cbSize = sizeof(DOCINFO);
di.lpszDocName = m_strPathname;
// Do not print to file.
di.lpszOutput = NULL;
// Start the document.
StartDoc(hPrinterDC, &di);
// Find out real size of document in characters.
lTextLength = m_RichEdit.GetTextLength();
do
{
// Start the page.
StartPage(hPrinterDC);
// Print as much text as can fit on a page. The return value is
// the index of the first character on the next page. Using TRUE
// for the wParam parameter causes the text to be printed.
lTextPrinted =m_RichEdit.FormatRange(&fr,true);
m_RichEdit.DisplayBand(&fr.rc );
// Print last page.
EndPage(hPrinterDC);
// If there is more text to print, adjust the range of characters
// to start printing at the first character of the next page.
if (lTextPrinted < lTextLength)
{
fr.chrg.cpMin = lTextPrinted;
fr.chrg.cpMax = -1;
}
}
while (lTextPrinted < lTextLength);
// Tell the control to release cached information.
m_RichEdit.FormatRange(NULL,false);
EndDoc (hPrinterDC);
DeleteDC(hPrinterDC);
}
void CMainFrame::OnDropFiles(HDROP hDropInfo)
{
CString FileName;
::DragQueryFile(hDropInfo, 0, FileName.GetBufferSetLength(_MAX_PATH),_MAX_PATH);
FileName.ReleaseBuffer();
::DragFinish(hDropInfo);
m_strPathname = FileName;
SetWindowTitle();
ReadFile();
}
void CMainFrame::ReadFile()
{
CString FileName = m_strPathname;
// Convert full filename characters from "\" to "\"
FileName.Replace(_T("\"), _T("\\"));
// The file from which to load the contents of the rich edit control.
CFile cFile(FileName, CFile::modeRead);
EDITSTREAM es;
es.dwCookie = (DWORD) &cFile;
es.pfnCallback = (EDITSTREAMCALLBACK) MyStreamInCallback;
m_RichEdit.StreamIn(SF_TEXT,es); // Perform the streaming
}
void CMainFrame::WriteFile()
{
// Convert full filename characters from "\" to "\"
CString Pathname = m_strPathname;
Pathname.Replace(_T("\"), _T("\\"));
// The file from which to load the contents of the rich edit control.
CFile cFile(Pathname, CFile::modeCreate|CFile::modeWrite);
EDITSTREAM es;
es.dwCookie = (DWORD) &cFile;
es.pfnCallback = (EDITSTREAMCALLBACK) MyStreamOutCallback;
m_RichEdit.StreamOut(SF_TEXT,es); // Perform the streaming
}
void CMainFrame::OnFileOpen()
{
// szFilters is a text string that includes two file name filters:
// "*.my" for "MyType Files" and "*.*' for "All Files."
char szFilters[]= "Text Files (*.txt)|*.txt|All Files (*.*)|*.*||";
// Create an Open dialog; the default file name extension is ".my".
CFileDialog fileDlg (TRUE, "txt", "*.txt",
OFN_FILEMUSTEXIST| OFN_HIDEREADONLY, szFilters, this);
// Display the file dialog. When user clicks OK, fileDlg.DoModal()
// returns IDOK.
if( fileDlg.DoModal ()==IDOK )
{
m_strPathname = fileDlg.GetPathName();
//Change the window's title to the opened file's title.
SetWindowTitle();
ReadFile();
}
}
DWORD CALLBACK MyStreamInCallback(CFile* dwCookie, LPBYTE pbBuff, LONG cb, LONG *pcb)
{
// Required for StreamIn
CFile* pFile = (CFile*) dwCookie;
*pcb = pFile->Read(pbBuff, cb);
return 0;
}
DWORD CALLBACK MyStreamOutCallback(CFile* dwCookie, LPBYTE pbBuff, LONG cb, LONG *pcb)
{
// Required for StreamOut
CFile* pFile = (CFile*) dwCookie;
pFile->Write(pbBuff, cb);
*pcb = cb;
return 0;
}
void CMainFrame::OnFileSave()
{
if (m_strPathname == "") OnFileSaveas();
else WriteFile();
}
void CMainFrame::OnFileNew()
{
//Clear the Richedit text
m_RichEdit.SetWindowText("");
m_strPathname = "";
SetWindowTitle();
}
void CMainFrame::OnFileSaveas()
{
// szFilters is a text string that includes two file name filters:
// "*.txt" for "Text Files" and "*.*" for "All Files."
char szFilters[]= "Text Files (*.txt)|*.txt|All Files (*.*)|*.*||";
// Create an Open dialog; the default file name extension is ".my".
CFileDialog fileDlg (FALSE, "txt", "*.txt",
OFN_OVERWRITEPROMPT| OFN_HIDEREADONLY, szFilters, this);
// Display the file dialog. When user clicks OK, fileDlg.DoModal()
// returns IDOK.
if( fileDlg.DoModal ()==IDOK )
{
m_strPathname = fileDlg.GetPathName();
//Change the window's title to include the saved file's title.
SetWindowTitle();
WriteFile();
}
}
void CMainFrame::SetWindowTitle()
{
CString Title;
if (m_strPathname == "") Title = "TextEdit - Untitled";
else Title = "TextEdit - " + m_strPathname;
SetWindowText(Title);
}
save as Mainfrm.cpp
2. // MainFrm.h : interface of the CMainFrame class
//
/////////////////////////////////////////////////////////////////////////////
#if !defined(AFX_MAINFRM_H__0BC0FB9E_F0B7_486A_A939_5894B9E590A9__INCLUDED_)
#define AFX_MAINFRM_H__0BC0FB9E_F0B7_486A_A939_5894B9E590A9__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
DWORD CALLBACK MyStreamInCallback(CFile* dwCookie, LPBYTE pbBuff, LONG cb, LONG *pcb);
DWORD CALLBACK MyStreamOutCallback(CFile* dwCookie, LPBYTE pbBuff, LONG cb, LONG *pcb);
class CMainFrame : public CFrameWnd
{
public:
CMainFrame();
CRichEditCtrl m_RichEdit;
void ReadFile();
void WriteFile();
void SetWindowTitle();
protected:
DECLARE_DYNAMIC(CMainFrame)
// Attributes
public:
// Operations
public:
// Overrides
public:
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
virtual BOOL OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo);
// Implementation
public:
virtual ~CMainFrame();
void Print(bool bShowPrintDialog);
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
protected: // control bar embedded members
CStatusBar m_wndStatusBar;
CToolBar m_wndToolBar;
CString m_strPathname;
// Generated message map functions
protected:
//{{AFX_MSG(CMainFrame)
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
afx_msg void OnSetFocus(CWnd *pOldWnd);
afx_msg void OnEditPaste();
afx_msg void OnEditCut();
afx_msg void OnEditCopy();
afx_msg void OnFilePrint();
afx_msg void OnDropFiles(HDROP hDropInfo);
afx_msg void OnFileOpen();
afx_msg void OnFileSave();
afx_msg void OnFileNew();
afx_msg void OnFileSaveas();
afx_msg void OnEditUndo();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_MAINFRM_H__0BC0FB9E_F0B7_486A_A939_5894B9E590A9__INCLUDED_)
save as Mainfrm.H
3. //{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by TextEdit.rc
//
#define IDR_MANIFEST 1
#define IDD_ABOUTBOX 100
#define IDR_MAINFRAME 128
#define ID_FILE_PRINT129 129
#define ID_FILE_OPEN130 130
#define ID_FILE_SAVE131 131
#define ID_FILE_NEW132 132
#define ID_FILE_SAVEAS 133
#define ID_BUTTON32771 32771
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 134
#define _APS_NEXT_COMMAND_VALUE 32774
#define _APS_NEXT_CONTROL_VALUE 1000
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif
save as resource.H
4. // stdafx.cpp : source file that includes just the standard includes
// TextEdit.pch will be the pre-compiled header
// stdafx.obj will contain the pre-compiled type information
#include "stdafx.h"
save as StdAfx.cpp
5. // stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//
#if !defined(AFX_STDAFX_H__9F5F3454_E717_4C4B_BCC3_4FF2438B3BC8__INCLUDED_)
#define AFX_STDAFX_H__9F5F3454_E717_4C4B_BCC3_4FF2438B3BC8__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
#include <afxwin.h> // MFC core and standard components
#include <afxext.h> // MFC extensions
#include <afxdisp.h> // MFC Automation classes
#include <afxdtctl.h> // MFC support for Internet Explorer 4 Common Controls
#ifndef _AFX_NO_AFXCMN_SUPPORT
#include <afxcmn.h> // MFC support for Windows Common Controls
#endif // _AFX_NO_AFXCMN_SUPPORT
save as StdAfx.H
6. // TextEdit.cpp : Defines the class behaviors for the application.
//
#include "stdafx.h"
#include "TextEdit.h"
#include "MainFrm.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
// CTextEditApp
BEGIN_MESSAGE_MAP(CTextEditApp, CWinApp)
//{{AFX_MSG_MAP(CTextEditApp)
ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
// NOTE - the ClassWizard will add and remove mapping macros here.
// DO NOT EDIT what you see in these blocks of generated code!
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
// CTextEditApp construction
CTextEditApp::CTextEditApp()
{
}
// The one and only CTextEditApp object
CTextEditApp theApp;
// CTextEditApp initialization
BOOL CTextEditApp::InitInstance()
{
InitCommonControls();
AfxInitRichEdit();
CWinApp::InitInstance();
// To create the main window, this code creates a new frame window
// object and then sets it as the application's main window object
CMainFrame* pFrame = new CMainFrame;
m_pMainWnd = pFrame;
// create and load the frame with its resources
pFrame->LoadFrame(IDR_MAINFRAME,
WS_OVERLAPPEDWINDOW | FWS_ADDTOTITLE, NULL,
NULL);
// The one and only window has been initialized, so show and update it
pFrame->ShowWindow(SW_SHOW);
pFrame->UpdateWindow();
return TRUE;
}
/////////////////////////////////////////////////////////////////////////////
// CTextEditApp message handlers
/////////////////////////////////////////////////////////////////////////////
// CAboutDlg dialog used for App About
class CAboutDlg : public CDialog
{
public:
CAboutDlg();
// Dialog Data
//{{AFX_DATA(CAboutDlg)
enum { IDD = IDD_ABOUTBOX };
//}}AFX_DATA
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CAboutDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
//{{AFX_MSG(CAboutDlg)
// No message handlers
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
{
//{{AFX_DATA_INIT(CAboutDlg)
//}}AFX_DATA_INIT
}
void CAboutDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CAboutDlg)
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
//{{AFX_MSG_MAP(CAboutDlg)
// No message handlers
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
// App command to run the dialog
void CTextEditApp::OnAppAbout()
{
CAboutDlg aboutDlg;
aboutDlg.DoModal();
}
/////////////////////////////////////////////////////////////////////////////
// CTextEditApp message handlers
save as TextEdit.cpp
7. # Microsoft Developer Studio Project File - Name="TextEdit" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Application" 0x0101
CFG=TextEdit - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "TextEdit.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "TextEdit.mak" CFG="TextEdit - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "TextEdit - Win32 Release" (based on "Win32 (x86) Application")
!MESSAGE "TextEdit - Win32 Debug" (based on "Win32 (x86) Application")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
MTL=midl.exe
RSC=rc.exe
!IF "$(CFG)" == "TextEdit - Win32 Release"
# PROP BASE Use_MFC 6
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 6
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Release"
# PROP Intermediate_Dir "Release"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /c
# ADD CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /Yu"stdafx.h" /FD /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0xc09 /d "NDEBUG" /d "_AFXDLL"
# ADD RSC /l 0xc09 /d "NDEBUG" /d "_AFXDLL"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 /nologo /subsystem:windows /machine:I386
# ADD LINK32 /nologo /subsystem:windows /machine:I386
!ELSEIF "$(CFG)" == "TextEdit - Win32 Debug"
# PROP BASE Use_MFC 6
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 6
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "Debug"
# PROP Intermediate_Dir "Debug"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /GZ /c
# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /Yu"stdafx.h" /FD /GZ /c
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0xc09 /d "_DEBUG" /d "_AFXDLL"
# ADD RSC /l 0xc09 /d "_DEBUG" /d "_AFXDLL"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
# ADD LINK32 /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
!ENDIF
# Begin Target
# Name "TextEdit - Win32 Release"
# Name "TextEdit - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=.\MainFrm.cpp
# End Source File
# Begin Source File
SOURCE=.\StdAfx.cpp
# ADD CPP /Yc"stdafx.h"
# End Source File
# Begin Source File
SOURCE=.\TextEdit.cpp
# End Source File
# Begin Source File
SOURCE=.\TextEdit.rc
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
SOURCE=.\MainFrm.h
# End Source File
# Begin Source File
SOURCE=.\Resource.h
# End Source File
# Begin Source File
SOURCE=.\StdAfx.h
# End Source File
# Begin Source File
SOURCE=.\TextEdit.h
# End Source File
# End Group
# Begin Group "Resource Files"
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
# Begin Source File
SOURCE=.
es\TextEdit.ico
# End Source File
# Begin Source File
SOURCE=.
es\TextEdit.rc2
# End Source File
# Begin Source File
SOURCE=.
es\Toolbar.bmp
# End Source File
# End Group
# End Target
# End Project
save as TextEdit.dsp
8. Microsoft Developer Studio Workspace File, Format Version 6.00
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
###############################################################################
Project: "TextEdit"=".\TextEdit.dsp" - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Global:
Package=<5>
{{{
}}}
Package=<3>
{{{
}}}
###############################################################################
save as TextEdit.dsw
9. // TextEdit.h : main header file for the TEXTEDIT application
//
#if !defined(AFX_TEXTEDIT_H__D30520A9_A3CB_40F3_B739_1124E3AF98F6__INCLUDED_)
#define AFX_TEXTEDIT_H__D30520A9_A3CB_40F3_B739_1124E3AF98F6__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#ifndef __AFXWIN_H__
#error include 'stdafx.h' before including this file for PCH
#endif
#include "resource.h" // main symbols
/////////////////////////////////////////////////////////////////////////////
// CTextEditApp:
// See TextEdit.cpp for the implementation of this class
//
class CTextEditApp : public CWinApp
{
public:
CTextEditApp();
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CTextEditApp)
public:
virtual BOOL InitInstance();
//}}AFX_VIRTUAL
// Implementation
public:
//{{AFX_MSG(CTextEditApp)
afx_msg void OnAppAbout();
// NOTE - the ClassWizard will add and remove member functions here.
// DO NOT EDIT what you see in these blocks of generated code !
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_TEXTEDIT_H__D30520A9_A3CB_40F3_B739_1124E3AF98F6__INCLUDED_)
save as TextEdit.H
10. //Microsoft Developer Studio generated resource script.
//
#include "resource.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "afxres.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// English (U.S.) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#endif //_WIN32
/////////////////////////////////////////////////////////////////////////////
//
// Icon
//
// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
IDR_MAINFRAME ICON DISCARDABLE "res\TextEdit.ico"
/////////////////////////////////////////////////////////////////////////////
//
// Bitmap
//
IDR_MAINFRAME BITMAP MOVEABLE PURE "res\Toolbar.bmp"
/////////////////////////////////////////////////////////////////////////////
//
// Toolbar
//
IDR_MAINFRAME TOOLBAR MOVEABLE PURE 16, 15
BEGIN
BUTTON ID_FILE_NEW
BUTTON ID_FILE_OPEN
BUTTON ID_FILE_SAVE
SEPARATOR
BUTTON ID_EDIT_CUT
BUTTON ID_EDIT_COPY
BUTTON ID_EDIT_PASTE
BUTTON ID_FILE_PRINT
SEPARATOR
BUTTON ID_APP_ABOUT
END
/////////////////////////////////////////////////////////////////////////////
//
// Menu
//
IDR_MAINFRAME MENU DISCARDABLE
BEGIN
POPUP "&File"
BEGIN
MENUITEM "New", ID_FILE_NEW
MENUITEM "Open ...", ID_FILE_OPEN
MENUITEM "Save", ID_FILE_SAVE
MENUITEM "Save as ...", ID_FILE_SAVEAS
MENUITEM "Print", ID_FILE_PRINT
MENUITEM SEPARATOR
MENUITEM "E&xit", ID_APP_EXIT
END
POPUP "&Edit"
BEGIN
MENUITEM "&Undo Ctrl+Z", ID_EDIT_UNDO
MENUITEM SEPARATOR
MENUITEM "Cu&t Ctrl+X", ID_EDIT_CUT
MENUITEM "&Copy Ctrl+C", ID_EDIT_COPY
MENUITEM "&Paste Ctrl+V", ID_EDIT_PASTE
END
POPUP "&View"
BEGIN
MENUITEM "&Toolbar", ID_VIEW_TOOLBAR
MENUITEM "&Status Bar", ID_VIEW_STATUS_BAR
END
POPUP "&Help"
BEGIN
MENUITEM "&About TextEdit...", ID_APP_ABOUT
END
END
/////////////////////////////////////////////////////////////////////////////
//
// Accelerator
//
IDR_MAINFRAME ACCELERATORS MOVEABLE PURE
BEGIN
"C", ID_EDIT_COPY, VIRTKEY, CONTROL, NOINVERT
"V", ID_EDIT_PASTE, VIRTKEY, CONTROL, NOINVERT
VK_BACK, ID_EDIT_UNDO, VIRTKEY, ALT, NOINVERT
VK_DELETE, ID_EDIT_CUT, VIRTKEY, SHIFT, NOINVERT
VK_F6, ID_NEXT_PANE, VIRTKEY, NOINVERT
VK_F6, ID_PREV_PANE, VIRTKEY, SHIFT, NOINVERT
VK_INSERT, ID_EDIT_COPY, VIRTKEY, CONTROL, NOINVERT
VK_INSERT, ID_EDIT_PASTE, VIRTKEY, SHIFT, NOINVERT
"X", ID_EDIT_CUT, VIRTKEY, CONTROL, NOINVERT
"Z", ID_EDIT_UNDO, VIRTKEY, CONTROL, NOINVERT
END
/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//
IDD_ABOUTBOX DIALOG DISCARDABLE 0, 0, 235, 55
STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "About TextEdit"
FONT 8, "MS Shell Dlg"
BEGIN
ICON IDR_MAINFRAME,IDC_STATIC,11,17,20,20
LTEXT "TextEdit Version 1.0",IDC_STATIC,40,10,119,8,
SS_NOPREFIX
LTEXT "Copyright (C) 2005",IDC_STATIC,40,25,119,8
DEFPUSHBUTTON "OK",IDOK,178,7,50,16,WS_GROUP
END
#ifndef _MAC
/////////////////////////////////////////////////////////////////////////////
//
// Version
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,0,0,1
PRODUCTVERSION 1,0,0,1
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x4L
FILETYPE 0x1L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904e4"
BEGIN
VALUE "FileDescription", "Text Editor
Yeah just go to the Object Oriented Programming category. Post something there and I will help you.
cool. How do you embed it in a webpage? I heard that if you don't have java then you can embed it in html to make it work. How do you do that?
here is how to do it.
save as h.html
<html>
<body>
<script type="text/javascript">
<!--
document.write("Hello World!")
//-->
</script>
</body>
</html>
Experience any problems and write them below.
this is easy.
copy this into notepad and save as h.html:
<html> <head> <title>Hello</title> </head> <body> <p>Hello, World</p> </body> </html>
that's all. Experience any problems then pst them below.
Here is how you create a Hello, World! in C++.
Copy this into notepad and save as h.cpp.
here is the program:
//h.cpp
#include<STDIO.H>
#include<CONIO.H>
int main()
{
printf("Hello, World!);
getch();
return 0;
}
//end of h.cpp
Compile and run this and your done.
Goto http://www.tizag.com/phpT , http://www.tizag.com/perlT , http://tizag.com/aspTutorial . There you can learn how to program in these languages.
Goto http://www.tizag.com/javascriptT , http://www.tizag.com/vbscriptTutorial , http://www.tizag.com/ajaxTutorial. There you can learn how to program in these languages.
Go to http://www.tizag.com/htmlT to learn HTML, http://www.tizag.com/cssT to learn CSS, or http://www.tizag.com/xmlT to learn XML. Happy Programming!
This is a web programming forum. No cursing or you will be kicked off immediately. Post only things that are related to the category. Happy programming!