Beruflich Dokumente
Kultur Dokumente
I. ThitkvtomtngdngtrongC++
1) KhingVC++:ChnStart>chnMicrosoftVisualC++
2) Tomtngdngmi:
ChnmenuFile>New>XuthincasNew,TachnthProjects,Sau
thchinydbabcsau:
Bc1:ChnMFCAppWizard(exe)
Bc2:XcnhthmcchangdngtrongmcLocation
Bc3:ttnchongdngtrongmcProjectName
> Xut hin ca s MFC AppWizard cho php ta chn mt trong ba Kiu
giao din ca ng dng l Single Document, Multiple Documents v Dialog
Based.
3) Dchccthnhphntrongmtngdng:chnRebuildAll
4) Thcthichngtrnh:ChnmenuBuild>chnExecute
II. TmhiumitrngphttrincaC++
1) Mmtngdngtnti:ChnmenuFile>chnOpenWorkspace>chntn
filecangdng(thngcphnmrng.dsw) >chnOpen.
2) CasWorkspace: thngcbathnhphnClassView,ResourceView,vFileView
ClassView:dnghinthttccclpctrongngdng
ResourceView:dnghinthdanhschcctinguynctrongngdng
nh:Dialog,Icon,Menu,Bitmap,
FileView:dnghinthdanhschccfilectrongngdng
III. Tomtngdngngin
Vd:TomtngdngKiuDialogxutHpthngbochacuChaoban!.
1) ButtonControl:dngthchinmtlnh nginbngcchClickvon.
Lp CButton: c dn xut t cc lp sau: CObject > CCmdTarget >
CWnd>CDialog>CButton.
itngnycskinquantrnglClick
tccthuctnhchoButton:chnButtonControl >nhnntphi,vchn
Properties
Mi Control c mt ch s ID, v ta dng n thc hin cc tc ng ln
Control.
2) XuthpthngbotadnghmMessageBox.
HmctipungAfx:
intAfxMessageBox(
LPCTSTRlpszText,
UINTnType=MB_OK,
UINTnIDHelp=0
TronglpCWnd:
intMessageBox(
LPCTSTRlpszText,
LPCTSTRlpszCaption=NULL,
UINTnType=MB_OK
)
3) CpnhtControlButtontrongqu trnhthcthi:
LpCWnd:
HmGetDlgItem():trvcontrchnmtControl hocmtcascon trongmt
DialoghocmtcaskhccchsnID.
CWnd*GetDlgItem(
intnID
)const
voidGetDlgItem(
intnID,
HWND*phWnd
)const
HmIsWindowVisibled():hmtrvkhc0nucasVisible
BOOLIsWindowVisible()const
HmIsWindowEnabled():Hmtrvkhc0nucasEnable
BOOLIsWindowEnabled()const
HmEnableWindow():Enableshocdisablesmtcas
BOOLEnableWindow(
BOOLbEnable=TRUE
)
HmSetWindowText():ttiuchomtcas
voidSetWindowText(
LPCTSTRlpszString
)