You are on page 1of 12

()

VC++
MFC

VisualStudio.net VC++6.0

Windows
Windows

Visual C++

Windows
Accelerator

Toolbar
Cursor32*32
Dialog
Icon
Menu
String Table
Version
Visual C++
Visual C++

.. MFC
VC6.0 FileNew
FileNewNew1-1

-1-

1-1

1
MFC AppWizard Step 1
1-2

1-2
Step 1
SDISingle Document Interface
FileNewOpen
Windows

-2-

MDIMultiple Document Interface


Window
Office Word

HelloWorld
Single DocumentFinish
NextVC++.PDF
19-24

1-3
,MFC /
CHelloApp
CHelloApp
CMainFrame
CMainFrame
CHelloDoc,
CHelloDoc
CHelloView, s
CHelloView
CAboutDlg
CAboutDlg

InitInstance()InitInstance()
TRUE

VC++.PDF29-39

-3-

1-4

3
3.1
1-5,

1-5 -1

-4-

1-6IDID
ID_MENUITEM_XXXXXXXX

1-6 -2
3.2
1-7 ClassWizard

1-7
MFC 1-8

-5-

1.
2.
3.
4.
5.
6.
7.

1-8
Message Maps
Object IDs ID
Class Name

Nessages COMMAND
Add Function
Member function name:

OK 1-9

1-9
Edit Code

-6-

1-10

1-10
MessageBox("","",MB_OK);

1. Insert

2-1

-7-

2-2 Dialog New 2-3


IDD_DIALOG1

2-2

2-3
OK
Create a new class OK 2-4
2-4 CGy(),
Gy.cpp

-8-

2-4
2.,
1-10
void CMainFrame::OnMenuitemLabman()
{
// TODO: Add your command handler code here
CGy cGy;
cGy.DoModal();
}
gy.h MainFrame.cpp

:, 2-4 ,

VC++.PDF 62-72

-9-

2-4

1.
1.

2
3-1 VC++.PDF 58-6
58-62

3-1
2.
2.

- 10 -

ID ID IDC_EDIT1
strBuf 100
strBuf
char strBuf[101];
GetDlgItemText(IDC_EDIT1,LPTSTR(strBuf),100);
3.
3.
strBuf IDC_EDIT1
char strBuf[101]=;
SetDlgItemText(IDC_EDIT1,strBuf);
MFC FTP MFC .chm

- 11 -

You might also like