Sei sulla pagina 1di 21

.

snur margorp eht sa etacinummoc stcejbo ruof esehT


.derots si atad smargorp eht erehw si )ppc.coDemocleWxx dna h.coDemocleWxx( tcejbo tnemucod ehT .neercs eht no stcejbo rehto dna segassem yalpsid ot su swolla elif ppc.weiVemocleW eht ni dohtem )(warDnO ehT .wodniw eht fo aera tneilc eht ni atad syalpsid )ppc.weiVemocleWxx dna h.weiVemocleWxx( tcejbo weiv ehT .rab sutats dna rabloot ,rab unem ,rab eltit eht rof elbisnopser si )ppc.mrFniaM dna h.mrFniaM( tcejbo wodniw niam ehT .srehto ynam dna TNOFTES_MW ,wodniw eht seziser resu eht fi EZIS_MW ,stiuq resu eht fi TIUQ_MW edulcni segassem esehT .wodniw niam eht ot metsys gnitarepo eht morf segassem swodniW gnissap dna neercs eht no wodniw niam eht gnicalp ,margorp eht gnitrats :sksat eerht sah tcejbo sihT .detrats margorp eht teg ot dohtem )(niaMniW eht gnillac yb tsrif snur yllautca swodniW tahw si )ppc.emocleWxx dna h.emocleWxx( tcejbo noitacilppa ehT .margorp ++C lausiV a ni strap cisab ruof era erehT .margorp ++C lausiV a etaerc ot sessalc noitadnuoF tfosorciM esu ot si pets tsrif ehT

tcejorp tsrif ruoy gnisinagrO


.spool roF detseN :11 ytivitcA srebmun iccanobiF yalpsid ot pool tset-tsoP :01 ytivitcA rotareneg rebmun modnaR :8 ytivitcA repeeB pool tset-erP :7 ytivitcA snoitaretI tsoPlecraP :6 ytivitcA noitceleS yawitluM )noitceleS yraniB( retrevnoC tnemerusaeM :5 ytivitcA noitceleS yraniB ecneuqeS orez yb noisivid diova dna rotaluclac a etaerC :4 ytivitcA sexob golaiD :3 ytivitcA snoitcnuf dna selbairaV ,sepytataD regnahC ruoloC :2 ytivitcA srab llorcs dna sreldnah tnevE rotide uneM dna neercs emocleW :1 ytivitcA :etagivan uoy pleh yam sgnidaeh gniwollof ehT )15.p ,suballys DDS( .rennam lacidohtem a ni noitulos erawtfos detnemucod dna detset ylluf a tnemelpmi ot nrael stnedutS snoitulos erawtfos fo tnempoleved dna ngised eht etatilicaf ot erawtfos etairporppa seilppa dna stceles tneduts A 3.5H

emoctuo suballyS
.)tset-tsop dna-erp :noitareti ,yawitlum dna yranib :noitceles ,ecneuqes( serutcurts lortnoc evif eht etartsnomed ot sesicrexe gnicudortni dna smret yek gninifed ,ecafretni resu 23 swodniW a tnemelpmi ot sessalc CFM fo esu eht dna tnemnorivne gnimmargorp eht gnicudortni ,6 ++C lausiV ot ediug srennigeb a sniatnoc lairotut sihT

lairotuT gnimmargorP 6 ++C lausiV

meti unem a gnidda dna neercs emoclew a gnitaerC :1 ytivitcA

.tnof dlob ni senil owt eht dda dna edoc eht fo noitces siht dnif ,weiv ecapskroW eht ni gnikcilc elbuod yb h.coDemocleWxx nepO .elif redaeh stnemucod eht ni gnirts_yojne dna gnirts_emoclew selbairav gnirts owt gniralced yb tratS .evoba debircsed stcejbo ruof eht fo hcae ot gnignoleb selif eht rof kool ot wodniw ecapskroW eht ni bat weiVeliF eht esU .spets rehto eht lla rof stluafed eht tpecca nehT .tnemucod elgniS tceles ,1 petS nI .draziWppA CFM eht trats ot KO kcilc dna noitacol a esoohc ,xob eman tcejorP eht ni emocleWslaitini ruoy eman eht margorp wen eht eviG .xob golaid weN eht ni bat stcejorp eht rednu yrtne )exe( draziWppA CFM eht tceles ,unem eliF eht ni weN kcilC ++C lausiV nepO

// xxWelcomeDoc.h : interface of the xxWelcomeDoc class // ///////////////////////////////////////////////////////////////////////////// #if !defined(AFX_xxWELCOMEDOC_H__9442116A_C7A7_11D3_BBC0_0000E883F891__INCLUDED_) #define AFX_xxWELCOMEDOC_H__9442116A_C7A7_11D3_BBC0_0000E883F891__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 class xxWelcomeDoc : public CDocument { protected: // create from serialization only xxWelcomeDoc(); DECLARE_DYNCREATE(xxWelcomeDoc) CString welcome_string; CString enjoy_string;

// xxWelcomeDoc construction/destruction

xxWelcomeDoc:: xxWelcomeDoc () { welcome_string = "Welcome to Visual C++"; enjoy_string = "Enjoy!";


// TODO: add one-time construction code here }

// xxWelcomeView drawing void xxWelcomeView::OnDraw(CDC* pDC) { xxWelcomeDoc* pDoc = GetDocument(); ASSERT_VALID(pDoc); CRect rect; GetWindowRect(&rect); int x = rect.Width()/2; int xx = rect.Width()/2; int xxx = rect.Width()/2; int y = rect.Height(); int yy = rect.Height()/2; int yyy = rect.Height()- 20; CBrush myBrush; CBrush backBrush;

.gnihctah ssorc eulb-yneerg htiw dellif espille na dda dna eulb neercs eht flah ruoloc ,)dohtem )(tnemucoDteG eht htiw txet eht dna dohtem )(tceRwodniWteG eht htiw snoisnemid wodniw eht gnitteg( txet ruoy ertnec lliw edoc sihT .nwohs sa senil eht ddA .elif ppc.weiVemocleWxx eht nepo ,neercs eht no segassem eht yalpsid oT

.nwohs sa enil hcae fo dne eht ta ; eht gnicalp dna yltcaxe gniypoc tuoba yssuf yrev eb ot tegrof tnoD .edoc fo senil dlob eht gnidda yb ppc.coDemocleWxx elif eht ni rotcurtsnoc sssalc stnemucod eht ni stcejbo gnirts_yojne dna gnirts_emoclew eht ezilaitini woN
//Declare a pointer variable //An error handler macro //Find the Windows dimensions //and create some variables to //position text // Construct brushes to do the cross hatching and background colour // Then initialize and use them. if(myBrush.CreateHatchBrush(HS_DIAGCROSS, RGB(0, 200, 240))) { CBrush* pOldBrush = pDC->SelectObject( &myBrush );

.tcejbo gnirts eht eralced ot tnof dlob ni edoc eht dda dna h.coDemocleWxx elif eht nepO .gnirts eht erots ot ataDgnirtS dellac elbairav a esilaitini dna eralced ot deen ew siht od oT .neercs eht fo mottob eht no deretnec sunem ot emocleW yalpsid lliw ew ,meti unem wen ruo skcilc resu eht nehW .ti tpecca ot KO kcilC .)(emocleWtnirPeliFnO fo reldnah tneve eht rof eman eht gnitseggus xob egassem a pu sgnirb sihT .xob segasseM eht ni dnammoC kcilc elbuod neht ,tsil sdI stcejbO eht ni EMOCLEWTNIRP_ELIF_DI tceles dna dniF .xob eman ssalC eht ni detceles ssalc eht si weiVemocleWxx erus ekaM .reldnah tneve na ot meti unem wen eht tcennoc ot )unem weiV eht rednu dnuof( draziWssalC eht esU DI eht meti unem wen eht sevig sihT .xob eht esolc dna xob noitpac eht ni noitpac eht ecalp ,xob seitreporP metI uneM eht nepo ot kcilc elbuoD .smeti unem puteS tnirP dna weiverP tnirP neewteb ot pu ti gard dna )yrassecen fi xob a dda ot yek tresnI esu( mottob eht ta xob eht barg dna nepo ot unem eliF eht no kcilC .EMARFNIAM_RDI kcilc elbuod neht ,unem ediseb + eht kcilc ,wodniw ecapskroW eht ni bat secruoser eht kcilC .rotide unem eht esu ,meti unem a dda oT .uneM dliuB eht morf etucexe RO noci kram noitamalcxe der htiw margorp uoy nuR .niaga dliub dna .cte ,gnipyt ssim ,snolocimes ,stekcarb gnissim rof ylluferac kcehc dna edoc fo enil eht ot uoy ekat ot kcilc elbuod ,srorre yna evah uoy fi .yek noitcnuf 7F eht htiw margorp ruoy dliuB
//Position and display enjoy_string CSize size2 = pDC->GetTextExtent(pDoc->enjoy_string); xx += (size2.cx/2 + 50); pDC->TextOut(xx, yy, pDoc->enjoy_string); Print Welcome ID_FILE_PRINTWELCOME.

.rotcurtsnoc stnemucod eht ni tcejbo gnirts eht ezilaitini dna ppc.coDemocleWxx nepo nehT

xxWelcomeDoc:: xxWelcomeDoc () { welcome_string = "Welcome to Visual C++"; enjoy_string = "Enjoy!"; StringData = ""; // TODO: add one-time construction code here
// xxWelcomeDoc construction/destruction public: virtual ~CShwelcomeDoc(); CString StringData; } // TODO: add draw code for native data here } if(backBrush.CreateSolidBrush(RGB(0,0,250))) { CBrush* pOlderBrush = pDC->SelectObject (&backBrush); pDC->Rectangle (x*2,y,x,0); pDC-> SelectObject(pOlderBrush); } //Centre and display welcome_string CSize size = pDC->GetTextExtent(pDoc->welcome_string); x -= size.cx/2; pDC->TextOut(x, 0, pDoc->welcome_string); pDC->Ellipse(CRect(50, 100, 250, 250)); pDC->SelectObject( pOldBrush );

.ecnatirehni yb ssalc taht morf devired ro ssalc taht fo stcejbo ot ssecca evig ot desu si drowyek detcetorp ehT .margorp eht fo strap rehto lla ot elbaliava si rebmem taht taht snaem drowyek cilbup ehT .etavirp sa srebmem atad lla eralced ot lausu si tI .noitcnuf ro rebmem atad taht ot ssecca evah ssalc taht fo stcejbo ylno taht snaem drowyek etavirp ehT .sessalc nihtiw snoitcnuf dna srebmem atad fo epocs eht tes ot desu sdrowyek era sreifidom sseccA .dedda serutaef artxe evah dna ssalc esab sti fo seitreporp eht lla tirehni nac ssalc devired a ,ecnatirehni gnisU .ecnatirehni stroppus osla ++C lausiV .sepyt esoht fo stcejbo gnitaerc era ew ,snottub dnammoc ro slebal etaerc ew nehW .krow fo laed taerg a sevas hcihw ,yrarbil CFM eht ,sessalc denifederp fo yrarbil a htiw etelpmoc semoc ++C lausiV .selif )ppc.( edoc ecruos eht ni detaerc era )epyt sssalc taht fo selbairav sa fo thguoht eb nac hcihw( ssalc taht fo stcejbo dna denifed era sessalc ,gnimmargorp ++C nI era atad eht gnildnah rof sdohtem dna atad ,noitinifed ssalc eht nI .tcejbo na etaerc ot desu si taht )etalpmet ro( noitpircsed a si ssalc A

.)(eniLward ro )(warDnO ekil ,atad taht eldnah ot )sdohtem ro( snoitcnuf eht dna neercs eht no deyalpsid eb ot atad eht htob edulcni dluoc tcejbo neercs sihT . dellac tcejbo na ni rehtegot tup eb thgim margorp a fo strap gnildnah neercs eht lla ,elpmaxe roF .noitaluspacne dellac si rehtegot gnipuorg sihT .ksat etercsid a mrofrep ot rehtegot pu depparw selbairav dna snoitcnuf sniatnoc dna neercs eht no sraeppa taht gnihtyna gniht a si tcejbo nA .++C ekil segaugnal detneiro-tcejbo ni stpecnoc latnemadnuf owt era sessalc dna stcejbO
screen

srab llorcs dna sreldnah tnevE


} } Build your code with the F7 function key. When it is free of errors, run your code. What happens when you click on the Print Welcome menu item?

.ppc.weiVemocleWxx ni edoc gniwollof eht dda ew ,emocleW tnirP skcilc resu eht nehw tcejbo ataDgnirtS eht ni sunem ot emocleW gnirts eht dda oT

void xxWelcomeView::OnDraw(CDC* pDC) { . // This represents existing code . CSize menuSize = pDC->GetTextExtent(pDoc->StringData); xxx -= menuSize.cx/2; yyy -= 20 ; pDC->TextOut(xxx, yyy, pDoc->StringData); void xxWelcomeView::OnFilePrintwelcome() { xxWelcomeDoc* pDoc = GetDocument(); ASSERT_VALID(pDoc); Finally we add the code to the end of OnDraw() in xxWelcomeView.cpp to display the text in StringData //Invalidate calls the OnDraw()method to display the new string Invalidate(); pDoc->StringData = "Welcome to menus!";

regnahC ruoloC :2 ytivitcA sdohtem ot atad refsnart sreldnah tnevE .neercs eht no neppah taht sgniht era stnevE
.ksat eht etelpmoc taht

.regnahCruoloC ti llac dna )exe( draziWppA CFM eht gnisu ecapskrow wen a ni tcejorp wen a nepO

.spets rehto eht ni stluafed eht tpecca dna desab golaid tceles ,1 petS draziWppA nI

.siht htiw pleh lliw unem tuoyaL ehT .nwohs sa srab llorcs eht dna lebal pot eht neewteb ecaps emos evaeL .margaid eht ni nwohs sa yltaen meht egnarrA .pot eht ssorca lebal a dna meht ediseb sexob tide eerht dda ,txeN .ylneve meht egnarra dna meht ngila ,ezis emas eht meht ekam ot unem tuoyal eht esu dna lla tceleS .xobloot eht morf srab llorcs latnoziroh eerht dda nehT .eteled dna .. ODOT eht no kcilC

.xob golaid eht no lebal hcae ot ylppa lliw sihT .llew skrow 21 kcalB lairA .tnof a tceles ot siht esu dna seitreporP sti pu gnirb ot xob golaid eht fo dnuorgkcab eht kcilc thgiR ylevitcepser dna eerht rehto eht dna noitpac eht lebal pot eht eviG .redrob a meht evig dna yllacitrev ertnec ,ertnec:txet ngila ,)bat selyts eht rednu( hcae rof dna xob seitreporp eht pu gnirb ot lebal hcae kcilc thgiR
Colour Changer Red, Green Blue .

.raB llorcS ralucitrap a ot etaler ton seod siht taht etoN .snoitcnuf rebmem eht ot llorcSHnO dda ot kcilc elbuoD .LLORCSH_MW dnif uoy litnu segasseM eht nwod llorcs nehT .detceles eman ssalc eht si glDregnahCruoloCC taht dna detceles si bat spaM egasseM eht erus ekaM .draziW ssalC eht nepo ot unem weiV eht esU

.)3txet_m htiw( 3TIDE_CDI dna )2txet_m gnisu( 2TIDE_CDI rof pets siht taepeR .epyt elbairav ruoy rof gnirtSC esoohc dna yrogetac )eulav( tluafed eht tpecca ,1txet_m ti emaN .elbairaV ddA neht ,xob sdI lortnoC eht ni 1TIDE_CDI no kcilC .draziW ssalC ni bat selbairaV rebmeM eht ot egnahc woN

.emit hcae devom si rab llorcs hcihw dnif ot desu eb lliw sihT .epyt elbairaV eht rof raBllorcsC dna yrogetaC eht rof lortnoC esoohc ,ylevitcepser 3edils_m dna 2edils_m ,1edils_m meht emaN .elbairaV ddA gnisu ,rab llorcs hcae ot eman a evig ,draziW ssalC eht fo bat selbairaV rebmeM eht ni llitS

.dlob ni edoc eht dda niagA .reilrae deralced selbairav eulb_n dna neerg_n ,der_n eht yb denimreted dna orcam BGR eht ni denifed sruoloc eht tniap ot ssalc hsurBC eht fo tcejbo wen a eralced dna ot ward ot )CDp( txetnoc ecived wen a tcurtsed dna tcurtsnoc ew ,edoc siht nI .dohtem )(1nottuBnO::glDregnahCruoloCC diov eht ot edoc dda ot si pets tsal ehT

.eulb_n dna neerg_n ,der_n ,selbairav eerht eht otni dna sexob tide eht otni eulav rabllorcs eht daer ot dohtem llorcSHnO::glDregnahCruoloCC diov eht ot edoc gniwollof eht ddA

.dlob ni edoc eht dda dna noitasilaitini ssalc eht dniF .elif edoc ecruos ppc.glDregnahCruoloCC eht ot edoc emos dda woN

.noitcnuf rebmem 1nottuBnO eht dda ot DEKCILC_NB egassem eht kcilc elbuod dna 1NOTTUB_CDI tceles ,detceles ssalc eht si glDregnahCruoloCC erus ekam ,bat spaM egasseM eht tceles ,niaga draziW ssalC eht nepo nehT .seitreporP gninepo dna gnikcilc thgir yb ruoloc eht ees ot kcilC ot noitpaC sti egnahc dna nottub a ddA
BOOL CColourChangerDlg::OnInitDialog() { CDialog::OnInitDialog(); m_slide1.SetScrollRange(1,255, true); m_text1 = "1"; m_slide2.SetScrollRange(1,255, true); m_text2 = "1"; m_slide3.SetScrollRange(1,255, true); m_text3 = "1"; UpdateData(false); n_red = 1; n_green = 1; n_blue = 1; // Add "About..." menu item to system menu. //Set scroll bar range and //intitialise edit boxes to 1 //This updates data from the //variable to the edit box. //(True) updates data from //the textbox to the variable. //Declare and initialise three //integer variables. void CColourChangerDlg::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar) { if(nSBCode == SB_THUMBPOSITION) { if (pScrollBar == &m_slide1){ m_text1.Format("%ld", nPos); UpdateData(false); n_red = nPos; } if (pScrollBar == &m_slide2){ m_text2.Format("%ld", nPos); UpdateData(false); n_green = nPos;} if (pScrollBar == &m_slide3){ m_text3.Format("%ld", nPos); UpdateData(false); n_blue = nPos;} } else { CDialog::OnHScroll(nSBCode, nPos, pScrollBar); } }

.stnemugra fo selpmaxe htob era dna .htiw krow ot atad sah noitcnuf eht os noitcnuf a ot ssap uoy eulav a si tnemugra nA .)ssalc eht fo sdohtem dellac( snoitcnuf detaler dna atad enibmoc sessalC
unsigned long myValue = 2; unsigned long cubed = cube(myValue) unsigned long squared = square(cubed) //cubed = 8 //squared = 64 myValue cubed

.g.e ,sksat lacitamehtam cisab mrofrep emoS .tluser elgnis a snruter dna stnemugra erom ro eno ,orez stpecca taht edoc fo tnemges a si noitcnuf A mune gnirtSC elbuod taolf tni gnol sepytatad denifederp no desab sepytatad gninifed roF sretcarahc ciremunahpla fo sgnirts gnildnah rof ssalc ++C denifederp A .epytatad elpmis a yllaer toN )stigid 91( 2394 -/+ E2.1 ta elbuod gnol a evah osla nac uoY( )stigid 51( 803 -/+ E7.1 ot srebmun laeR )stigid 7( 83 -/+ E4.3 ot srebmun laeR 746,384,741,2 ot 846,384,741,2 morf seulav regetnI

.++C ni elbaliava sepytatad elpmis eht fo emos stsil elbat gniwollof ehT .epytatad deralced eht yb denimreted ezis a fo snoitacol yromem deman era selbairaV

ereh edoc reldnah noitacifiton lortnoc ruoy ddA :ODOT //

;)hsurBredlOp(tcejbOtceleS >-CDp
CBrush* pOlderBrush = pDC->SelectObject (&backBrush); pDC-> Ellipse(50,70, 140,130);

void CColourChangerDlg::OnButton1()

//NB This code depends on using the #include <CMath> header file // at the beginning of this code.

592,769,492,4 ot 0 morf seulav regetnI tni gnol dengisnu 767,23 ot 867,23 morf sregetnI .)tnedneped metsys si tni redlo eht tub( 535,56 0 morf sregetnI 552-0 morf slamiced tuohtiw seulav ciremun evitisoP eslaF ro eurT .g.e .ylno seulav owt fo enO tni trohs )tni RO( trohs dengisnu rahc dengisnu loob

egnaR dna noitpircseD

epytataD

snoitcnuf dna sepytatad ,selbairaV


.edoc ruoy etucexe dna )7F( dliub woN

} delete pDC;

if(backBrush.CreateSolidBrush(RGB(n_red,n_green,n_blue))) CClientDC* pDC = new CClientDC(this); CBrush backBrush;

.neercs eht fo aera tneilc niam eht no egassem desilanosrep a yalpsid ot atad taht esu dna atad tupni ot resu a wolla ot xob golaid a esu lliw ew margorp siht nI

sexob golaiD :3 ytivitcA


.nolocimes a htiw dedne ton si flesti noitcnuf eht tub ,snolocimes ni dne tsum secarb eht nihtiw stnemetats llA .noitcnuf eht fo ydob eht dnuorrus tsum secarb dna ,sretemarap eht lla rof seman edivorp tsum tI .tsil retemarap dna epyt nruter ni epytotorp sti htiw eerga tsum noitinifed noitcnuf A
int CalculateArea(int l, int w) { return l*w; }

,elpmaxe roF

} ;stnemetats { )]emaNretemarap epyt[( eman_noitcnuf epyt_nruter :xatnys siht gnisu skrow noitcnuf eht woh relipmoc eht sllet noitinifed noitcnuf ehT .nolocimes a htiw sdne syawla epytotorp A .denruter eb ot si eulav on fi epyt nruter eht ekat yam noitcnuf A .ytpme fi neve sesehtnerap eht niatnoc tsum tub sretemarap evah ot deriuqer ton era snoitcnuF .tsil retemarap dna eman ,epyt nruter eht relipmoc eht sllet epytotorp noitcnuf A
int CalculateArea(int length, int width); void

,elpmaxe roF

;) ]]emaNretemarap[epyt[( eman_noitcnuf epyt_nruter :xatnys gniwollof eht gnisu epytotorp noitcnuf a ni deralced si noitcnuf A

.ppc.gld ot edoc dlob eht ddA .ssalc )(egnahcxEataDoD eht f0 dohtem )(txet_XDD eht gnisu lortnoc TIDE_CDI eht ot txet_m tcennoC .gnirtSC epyt sa yrogetac eulav eht fo txet_m elbairav eht etaerC .nottub elbairaV ddA eht kcilc dna 1TIDE_CDI tceles ,draziW ssalC eht fo bat selbairaV rebmeM eht ot egnahc woN .)(1nottuBnO noitcnuf rebmem wen eht setaerc sihT .xob segasseM eht ni yrtne DEKCILC_NB eht kcilc elbuod dna 1NOTTUB_CDI tceles ,nottub eht ot reldnah tneve na tcennoc oT .KO kcilC .glD ti eman dna ssalc wen a etaerc esoohC .ssalc xob golaid wen a etaerc ot unem weiV eht morf draziW ssalC esoohC .)!em ot klaT noitpac eht htiw( nottub a dna htaenrednu xob tide na ddA .esaelp eman ruoy ni epyT ot noitpac eht egnahC .seitreporp sti nepo dna kcilc thgir ,lebal a ddA .rotide xob golaiD eht snepo sihT .nottub wen eht kcilc dna yrtne golaiD eht tceleS .xob ecruoseR tresnI eht snepo sihT .unem tresnI eht morf meti ecruoseR eht tceles ,xob eugolaid tupni na etaerc oT .spets rehto eht lla rof stluafed eht tpecca nehT .tnemucod elgniS tceles ,1 petS nI .draziWppA CFM eht trats ot KO kcilc dna noitacol a esoohc ,xob eman tcejorP eht ni noitasrevnoCretupmoC eman eht margorp wen eht eviG .xob golaid weN eht ni bat stcejorp eht rednu yrtne )exe( draziWppA CFM eht tceles ,unem eliF eht ni weN gnitceles yb margorp wen a tratS

void Dlg::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX);

}
Dlg dlg; int display = dlg.DoModal(); // TODO: add construction code here

.)eurt(ataDetadpU htiw neercs niam eht ot kcab yalpsid dna xob egassem a yalpsid ,noitanetacnoc gnirts htiw ,ereht olleH ddA .elbairav eht ot xob tide eht morf sdaer hcihw )eslaf(ataDetadpU gnisu xob tide eht morf eman resu eht teG
} //{{AFX_DATA_MAP(Dlg) DDX_Text(pDX, IDC_EDIT1, m_text); //}}AFX_DATA_MAP

.ppc.weiVnoitasrevnoCretupmoC ni elif redaeh h.glD eht gnidulcni yb ssalc weiv eht ni ssalc glD ruo rof troppus eht edulcni ot evah ew siht od oT .xob golaid eht gniyalpsid si pets txen ehT
void Dlg::OnButton1() { UpdateData(true); m_text = "Hello there, " + m_text + "!"; UpdateData(false); AfxMessageBox(m_text); // TODO: Add your control notification handler code here }

]xob segassem eht ni etadpUlaitinInO kcilcelbuod dna detceles ssalc eht si weiVnoitasrevnoCretupmocC erus ekaM[ .dohtem etadpUlaitinInO eht dda ot draziWssalC eht esU ].desolc si ti retfa niaga xob golaid eht wohs ot resu eht elbane ot dohtem siht ot edoc fo senil emas eseht dda nac uoy )(golaidwohSeliFnO dohtem sssalc weiv eht ot eciohc unem taht tcennoc dna unem elif smargorP eht ot meti golaiD wohS a dda uoy fI :BN[ .eulav regetni na snruter hcihw ,dohtem )(ladoMoD eht htiw neercs eht no ti gniyalpsid dna ssalc taht fo tcejbo wen a gnitaerc yb ssalc glD ruo fo esu ekam nac ew woN
#include "ComputerConversationDoc.h" #include "ComputerConversationView.h" #include "Dlg.h"

.edoc dda woN .]DEKCILC_NB kcilcelbuod dna ,KODI dniF[ .ppc.glD ot dohtem )(KOno eht dda ot draziWssalC eht esU .nottub KO eht htiw desolc si xob golaid eht retfa neercs tneilc eht ot txet_m ni egassem eht dda ot si pets tsal ehT

#include "stdafx.h" #include "ComputerConversation.h"

// ComputerConversationView.cpp : implementation of the // ComputerConversationView class //

void Dlg::OnOK() { // TODO: Add extra validation here // to make sure m_text is holding the text from the edit box UpdateData(true); //to close the dialog box and return the value IDOK. void CComputerConversationView::OnInitialUpdate() { CView::OnInitialUpdate();

.resu eht yb nevig srebmun owt edivid dna ylpitlum ,tcartbus ,dda nac taht rotaluclac a etaerc ot xob golaid a esU

orez yb noisivid diova dna rotaluclac a etaerC :4 ytivitcA


.yletelpmoc derongi si edoc fo enil taht ,kramer eht fo tnorf ni decalp si // fI .ecnanetniam edoc rof noitamrofni dda ot ro edoc fo noitces a fo esoprup eht nialpxe ot edoc ni dedda era skrameR

.ti nur dna )ylluferac srorre yna gubed( ti dliuB .etelpmoc si margorp ehT
void CComputerConversationView::OnDraw(CDC* pDC) { CComputerConversationDoc* pDoc = GetDocument(); ASSERT_VALID(pDoc); // TODO: add draw code for native data here pDC->TextOut(0,0,pDoc->StringData); }

.h.coDnoitasrevnoCretupmoCC ot ataDgnirtS deman tcejbo gnirtSC a ddA }


} pDoc->StringData = dlg.m_text; Invalidate();

}
CDialog::OnOK();

.yalpsid eht etadpu ot ppc.weiVnoitasrevnoCretupmoCC ot edoc ddA

.dohtem )(warDnO sweiv eht ni xob golaid eht morf txet eht ward ,margorp eht etelpmoc oT
class CComputerConversationDoc : public CDocument { protected: // create from serialization only CComputerConversationDoc(); DECLARE_DYNCREATE(CComputerConversationDoc) // Attributes public: CString StringData; // Operations

.rotaluclaC ti llac dna )exe( draziWppA CFM eht gnisu ecapskrow wen a ni tcejorp wen a nepO

.spets rehto eht ni stluafed eht tpecca dna desab golaid tceles ,1 petS draziWppA nI

void CComputerConversationView::OnInitialUpdate() { CView::OnInitialUpdate();

Dlg dlg; int display = dlg.DoModal(); // TODO: add construction code here if(display ==IDOK){ CComputerConversationDoc* pDoc = GetDocument(); ASSERT_VALID(pDoc);

. eulav taolf a ot tcennoc dna mottob eht ta xob tide rehtona ddA . ro eulav ,taolf a ot hcae tcennoc ot unem weiV eht morf draziW ssalC eht esU .unem tuoyaL ni sloot gnisu pu meht enil dna sexob tide owt ddA .eteled dna .. ODOT eht no kcilC
number2

.ediviDnO dna ylpitluMnO ,tcartbuSnO ,ddAnO ot seman noitcnuf rebmem eht egnahc tub tneve DEKCILC_NB rieht kcilc elbuod ,niaga draziW ssalC gnisU .ediviD dna ylpitluM ,tcartbuS ,ddA ot snoitpac rieht egnahc dna seitreporP ssecca ot hcae kcilc thgir dna enil a ni snottub llams 4 ddA
number1 answer

.yletairporppa enil dnoces eht ni rotarepo eht gnignahc ,ediviDnO dna ylpitluMnO ,tcartbuSnO ot edoc emas eht dda ,etsap dna tuc gnisU .dohtem ddAnO eht ot edoc gniwollof eht dda dna ppc.glDrotaluclaC nepO

.gld dellac ssalc wen a etaerc ot stluafed eht tpecca dna xob golaid wen eht kcilc elbuoD ].seitreporp sti gnitceles dna dnuorgkcab xob golaid eht gnikcilc thgir yb ezis tnof ssecca nac uoy ,rebmemeR[ .rebmun rehtona retne esaelP !orez yb edivid tonnac uoY daer ot noitpac eht egnahc ,seitreporp eht ssecca ot kcilc thgir ,pot eht ssorca lebal citats a ecalP .golaid wen a dda ..ecruoseR ,unem tresnI eht morF .orez yb noisivid tpmetta ton seod margorp eht taht erusne ot woN
void CCalculatorDlg::OnAdd() { UpdateData(true); answer = number1 + number2; UpdateData(false); / /TODO: Add your control notification handler code here }

.xob golaid wen eht ssecca ot edoc dda dna niaga ppc.glDrotaluclaC nepO

.dohtem ediviDnO eht ni orez yb noisivid tneverp ot } ];stnemetats[ { esle } ];stnemetats[ { )noitidnoc( fi erutcurts lortnoc noitceles yranib eht esU
#include "dlg.h"

.etad eht dna eman ruoy sedulcni hcihw edoc ruoy fo pot eht ta )enil eht fo gninnigeb eht ta // tup( kramer a ddA .margorp ruoy nur dna dliuB
} void CCalculatorDlg::OnDivide() { UpdateData(true); #include "stdafx.h" #include "Calculator.h" #include "CalculatorDlg.h" // CalculatorDlg.cpp : implementation file // if (number2 == 0){ dlg error; int display = error.DoModal(); } else { answer = number1 / number2; UpdateData(false); } // TODO: Add your control notification handler code here

.smc 45.2 si sertemitnec ni tnemerusaem ehT !ti trevnoC 1

tnemerusaem eht retnE

sertemitneC ro

sehcnI ni tnemerusaem ruoy sI

)noitceleS yraniB( retrevnoC tnemerusaeM :5 ytivitcA


.orez yb gnidivid resu a tneverp ot rotaluclac ruoy ni noitceles yranib desu evah uoY .)seciohc elpitlum( yawitluM ro )yaw owt( yraniB eb nac stcurtsnoc noitceleS .edam eb ot seciohc rof swolla dna tneve yna rof syawhtap elpitlum swolla noitceleS .noitceles tcurtsnoc mhtirogla dnoces eht desu osla evah eW

smhtirogla noitceleS yraniB


void CCalculatorDlg::OnAdd() { UpdateData(true); answer = number1 + number2; UpdateData(false); } // Input user numbers // Calculate answer // Output answer

.g.e ,spets ssecorp dna tuptuo ,tupni fo tsisnoc dluow mhtirogla eht ,noitcnuf rebmem hcae rof ,oS .tneve hcae rof yawhtap elbissop eno ylno htiw rehtona dewollof edoc fo enil hcaE .stcurtsnoc mhtirogla ecneuqes morf detcurtsnoc ylniam erew 4 1 seitivitcA ni smargorp ehT

smhtirogla ecneuqeS

.)sertemitnec 45.2 = hcni 1 noisrevnoc eht gnisu( sehcni ot sertemitnec RO sertemitnec ot sehcni trevnoc ot retrevnoC dellac )desab golaid niaga( margorp wen a etaerC

.sehcni ot sertemitnec ro sertemitnec ot sehcni si noisrevnoc eht rehtehw etacidni ot resu eht rof )xobloot eht morf( snottub noitpo esU

.e.i .emit a ta detceles eb nac eno ylno ,evisulcxe yllautum era snottub noitpO .detceles si nottub noitpo hcihw no desab esu ot alumrof hcihw enimreted ot stnemetats fI esU

. ot nottub lecnac eht fo noitpac eht dna ot nottub KO eht fo noitpac eht egnahC .) deman taolf a ot detcennoc( xob tide rehtona dna smc ot sehcni dna sehcni ot smc dellebal snottub oidar owt ddA .tupni resu eht niatbo ot )draziWssalC eht yb deman taolf a ot detcennoc( xob tide na esU
Convert measurement answer Close

} tnemetats :tluafed . . . ;kaerb ;tnemetatS :noisserpxEtnatsnoC esac { tnemetatS )noisserpxEmunErOlargetni( hctiws


.stnemetats hctiwS hguorht noitceles elpitlum rof xatnys eht si ereH .stnemetats hctiwS esu ot retteb semitemos si tI .edoc daer-ot-drah ot dael nac dna detacilpmoc si siht tub stnemetats fI detsen esu nac uoy ,sevitanretla owt naht erom sevlovni noitceles eht fI .noitceles yranib fo elpmaxe na ta dekool ew ,5 ytivitcA nI

noitceles yawitluM
.456789000000.0 ,srebmun evitagen ,orez ,srebmun llams yrev ,srebmun egral yrev gnidulcni atad tset emos htiw tuo ti yrT .stluser eht yfirev ot rotaluclac ruoy esU .yltcerroc gnikrow si ti taht erusne ot noitacilppa eht nur dna dliuB
void CConverterDlg::OnOK() { UpdateData(true); if (flag == false) { answer = float(measurement * 2.54); unit = "cms"; UpdateData(false); } else { answer = float(measurement / 2.54); unit = "inches"; UpdateData(false); } //CDialog::OnOK(); }

.ppc.glDretrevnoC ni )(KOnO dna )(2oidaRnO ,)(1oidaRnO etaerc ot draziWssalC eht esU

.galf deman elbairav naeloob a dda dna h.glDretrevnoC nepO

.tnof dlob ni edoc gniwollof eht dda dna ppc.glDretrevnoC nepO


class CConverterDlg : public CDialog { // Construction public: CConverterDlg(CWnd* pParent = NULL); bool flag; // standard constructor

void CConverterDlg::OnRadio1() { flag = true; } void CConverterDlg::OnRadio2() { flag = false; // CConverterDlg dialog

:serutcurts noitareti cisab 2 era erehT .gnipool eht gnippots fo yaw a niatnoc TSUM noitareti hcaE .)semit fo rebmun detnuoc a rof ro( eurt sniamer noitidnoc emos elihw yldetaeper tuo deirrac eb ot stnemetats fo puorg ro tnemetats a wolla taht serutcurts era spool ro snoitaretI

snoitaretI
.tsil detaremune na fo srebmem neewteb hsiugnitsid ot desu semitemos era stnemetats hctiwS .yltnagele erom boj emas eht seod stnemetats- fi esle- deredro fo seires A .++C ni detnemelpmi ylerar era stnemetats hctiwS
}

.tnemetats hctiws a ni noitidnoc eht rof desu eb nac )rahc .g.e ,tnelaviuqe rieht ro( sregetni ylno taht etoN .euqinhcet eht esitcarp ot edoc ruoy ni stnemetats hctiwS esU .evoba nevig noitamrofni eht ot gnidrocca )tsoc dellac elbairav taolf detcennoc a htiw( xob tide na ni tsoc eht yalpsid dna nottub a skcilc resu eht nehw egatsop eht etaluclaC .)thgiew deman eulav taolf a ot detcennoc( xob tide na ni thgiew eht retne ot resu a swolla taht )desab golaid( tcejorp a ngiseD 20.0*thgiew yb detaluclac era g005 naht reivaeh era hcihw slecraP 05.7$ 00.4$ 07.2$ 04.1$ 005 052 001 05 152 101 15 0

tsoC

)marg( thgieW

.sthgiew tnereffid nopu desab slecrap rof segrahc gniwollof eht sah eciffo tsop ehT

tsoP lecraP :6 ytivitcA

.tem reven si noitidnoc eht fi lla ta nur ton lliw edoc eht dna pool eht fo gninnigeb eht ta srucco tem eb ot noitidnoc eht ,spool eseht nI :snoitareti tset-erP

void CParcelPostDlg::OnCalculate() { UpdateData(true); int type = 0;

default: } UpdateData(false); switch (type) { case < 1: case < 4: case < 3: case < 2:

if (weight < 51)type = 1; else if (weight < 101)type = 2; else if (weight < 251)type = 3; else if (weight < 501)type = 4;

cost = break; cost = break; cost = break; cost = break; cost =

float(weight * 0.02); float(7.50); float(4.00); float(2.70); float(1.40);

.stupni resu eht rebmun eht sa speeb ynam sa dnuos ot pool tset-erp a esu neht ,peeb a esuac ot lortnoC XevitcA na etaerc lliw ew ,tcejorp siht nI

repeeB pool tset-erP :7 ytivitcA


.ecno tsael ta snur syawla edoc eht taht os pool eht fo dne eht ta si tem eb ot noitidnoc eht ,spool eseht ni :snoitareti tset-tsoP

. tcejorP eht eman dna draziWlortnoC XevitcACFM tceles ,stcejorP..weN rednU .lortnoc XevitcA ruo etaerc tsriF
Beep

.ssalc peeB eht etaerc ot KO dna hsiniF kcilC ?ssalcbus lortnoc siht dluohs ,yna fi ,ssalc wodniw hcihW noitseuq eht rednu unem nwod pord eht ni NOTTUB tceles ,2 pets ni tub ,1 petS rof stluafed eht tpeccA

.edoc gniwollof eht tresni dna ppc.ltCpeeB nepO .noitpac a nottub ruoy eviG

.skcilc hcus eldnah ot reldnah-tneve kcilC a pu tes ot elba eb lliw lortnoc siht esu taht smargorp dna ,dekcilc si nottub eht emit hcae tneve kcilc a erif ot lortnoc eht sesuac edoc sihT .ppc.ltCpeeB ni lortnoC XevitcA ruo ot nottub eht skcilc resu eht nehw tneve kcilc eht erif ot edoc ddA .lortnoc XevitcA eht ot reldnah tneve )xob segassem eht ni NWODNOTTUBL_MW gnikcilc elbuod yb( )(nwoDnottuBLnO eht dda dna bat spaM egasseM eht tceles ,draziw ssalc eht ni llitS .KO dna kcotS si noitatnemelpmi eht taht kcehc dna )kcilCeriF fo eman lanretni na gnivig( eman lanretxe eht rof kcilC tceleS .tneve ddA tceleS .bat stneve XevitcA eht tceles dna unem weiV eht ni draziWssalC nepO .nottub eht ot tneve kcilc a dda ot deen ew woN
} // TODO: Initialize your control's instance data here. SetText("Click Me!");

.dohtem )(peeBegasseM CFM eht gnisu ,peeb retupmoc eht ekam ot edoc eht ddA .draziWssalC eht esolc dna KO kcilC .diov epyt nruter sti ekam dna peeB dohtem eht emaN .dohteM ddA tceles dna bat noitamotuA ,draziWssalC nepO .lortnoc ruo ot )(peeB ,dohtem eht dda ,lortnoc XevitcA ruo hsinif oT
void CBeepCtrl::OnLButtonDown(UINT nFlags, CPoint point) { // TODO: Add your message handler code here and/or call default FireClick(); COleControl::OnLButtonDown(nFlags, point); }

.swodniW htiw lortnoc taht sretsiger osla sihT .xco.peeB etaerc ot peeB dliub woN
void CBeepCtrl::Beep() { // TODO: Add your dispatch handler code here MessageBeep(MB_OK); }

.repeeB margorp siht gniman ,won draziWppA htiw margorp desab-golaid wen a etaerC

dnif ,redlof slortnoC deretsigeR eht nepO .)yrellaG slortnoC dna stnenopmoC ,stcejorP ot ddA( unem tcejorP eht gnisu xobloot srotide golaid eht ot lortnoc peeB ruoy ddA

CBeepCtrl::CBeepCtrl() { InitializeIIDs(&IID_DBeep, &IID_DBeepEvents);

.desu si ti emit hcae eulav dees tnereffid a sah ti taht os )thgindim tsap sdnoces ni( emit tnerruc eht ot )(dnars eit lliw eW .ecalp emas eht ta trats syawla ton seod )(dnar taht os eulav dees laitini na edivorp ot )(dnars esu ot deen osla lliw uoY .rebmun modnar a etareneg ot )(dnar ,noitcnuf wen a esU

rotareneg rebmun modnaR :8 ytivitcA

.speeb fo rebmun taht raeh ot kcilc neht ,01 dna 1 neewteb regetni na retnE denoitpac lebal a dna tupni resu tpecca ot xob tide na dda ,mrof ruoy no tresnI .peeB dellac xobloot ruoy ni lortnoc XCO na evah won lliw uoY .esolc dna peeBC eman tluafed tpeccA .tresnI dna peeB

.)(peeB.repeeb_m gnisu dohtem )(peeB eht esu nac ew woN .01 dna 0 ot seulav mumixam dna muminim eht teS .xobtxet eht ot tni epyt fo dellac elbairav a dna lortnoc peeB wen eht ot ,repeeb_m ,elbairav rebmem a tcennoc ot draziWssalC esU
counter

.)(1lrtcpeeBkcilCnO reldnah tneve wen eht dda ot kcilC kcilc elbuod dna 1LRTCPEEB_CDI tceles spaM egasseM nI .tneve kcilC slortnoc peeB eht ot reldnah-tneve na dda ot draziWssalC esU

.semit fo rebmun rof deksa eht )(peeB llac ot pool tset-erp a esU .dohtem peeB eht llac dna xob tide eht morf rebmun teg ot )(1lrtcpeeBkcilCnO ot edoc ddA

.esu txen rof orez ot kcab xob tide eht tes dna 01 dna 1 neewteb regetni na ot resu eht timil ot edoc dda ,nwod retupmoc eht wols ot xob tide elbisivni eht ot esuap fo eulav yalpsid ot pool roF a gnisu ,)(1lrtcpeeBkcilCnO ot edoc gniwollof eht dda woN . epyt fo dellac elbairav a dda ot draziWssalC esU .elbisiV tcelesed dna seitreporP ot kcilc thgir ,xob tide na ddA .nwod ti wols ot ksat rehtona rossecorp eht evig ot si melborp siht evlos ot yaw enO .peeb eno ekil dnuos dna suounitnoc era speeb eht taht tsaf os nur sretupmoc nredom tsom taht si melborp gniniamer ylno ehT
} } //Changes loop condition to //terminate loop pause long

.margorp ruoy nur dna dliuB


void CbeeperDlg::OnClickBeepctrl1() { UpdateData(true); while ((counter > 0) && (counter < 11)) m_beeper.Beep(); counter--; for (int pause = 0; pause<=20000; pause++) UpdateData(false); } counter = 0; UpdateData(false); }

.2 petS ni ssalc NOTTUB eht no ti esab dna draziWlortnoC XevitcA CFM eht esU .6 dna 1 neewteb rebmun modnar a etareneg ot )eciD dellac( nottub lortnoc XevitcA na ngiseD

void CbeeperDlg::OnClickBeepctrl1() { UpdateData(true); while (counter > 0) { m_beeper.Beep(); counter--;

//A pre-test loop based on a //counter condition.

}
void CRollTheDiceDlg::OnClickDicectrl1() { // TODO: Add your control notification handler code here /*Use char() to typecast integer returned by Random() so that it can be assigned to the CString variable m_text. */ m_text = char (m_button.Random()); UpdateData(false);

}
i = rand()% 6 + 1; return i;

;)tniop ,sgalFn(nwoDnottuBLnO::lortnoCelOC

. . }

.reldnah-tneve )(nwoDnottuBLnO eht etaerc ot NWODNOTTUBL_MW ot lrtCeciDC tcennoc spaM egasseM >-draziWssalC nI . epyt nruter eht ti gnivig dellac dohtem a dda ,dohtem ddA >-bat noitamotuA >-draziWssalC nI .KO dna eman lanretxe sa tceles ,tnevE ddA >-bat stneve XevitcA >-draziWssalC nI
short Click Random

.edoc fo senil gniwollof eht dda dna ppc.ltCeciD nepO

.dekcilc si eciD eht emit hcae tluser eht yalpsid ot xob tide na htiw gnola xob golaid eht no ecalP .)slortnoC dna stnenopmoC ,stcejorp ot ddA ,stcejorP ni( lortnoC eciD wen eht dda dna )eciDehTlloR( noitacilppa desab golaid wen a tratS

.)(1lrtceciDkcilCnO reldnah-tneve eht etaerc ot tneve kcilC eht ot 1LRTCECID_CDI tcennoc dna bat spaM egasseM ot egnahC .1LRTCECID_CDI ot )ssalc eciDC eht fo( nottub_m dna 1TIDE_CDI ot )tni na sa( txet_m dda ,selbairaV rebmeM>-draziWssalC gnisU

.ppc.glDeciDehTlloR ot edoc dlob eht ddA

.ti nur dna srorre yna gubed ,margorp eht dliuB

} short CDiceCtrl::Random()

void CDiceCtrl::OnLButtonDown(UINT nFlags, CPoint point) { // TODO: Add your message handler code here and/or call default FireClick();

CDiceCtrl::CDiceCtrl() { InitializeIIDs(&IID_DDice, &IID_DDiceEvents);

/* Seed the random-number generator with current time so that the numbers will be different every time */ srand( (unsigned)time( NULL ) ); // TODO: Add your dispatch handler code here int i; // TODO: Initialize your control's instance data here. // This line is to change the buttons caption. SetText("Roll the dice!");

.dohtem )(warDnO eht ni srebmun iccanobiF eht yalpsid ot edoc eht dda dna ppc.weiVsrebmuN nepO

.stcejbo eht esilaitini dna ppc.coDsrebmuN nepO

.noitces cilbup eht ni )2atad dna 1atad ,atad( stcejbo gnirtSC eerht dda dna )selif redaeh eht morf( h.coDsrebmuN nepO .srebmuN dellac tcejorp tnemucod-elgnis wen a tratS

.pool tset-tsop a ni snoitareti fo rebmun eht lortnoc ot retnuoc a esU .srebmun iccanobiF 02 tsrif eht etareneg ot margorp a etaerC
CNumbersDoc::CNumbersDoc() { // TODO: add one-time construction code here data = "The first 20 Fibonacci numbers are:"; data1 = ""; data2 = ""; } void CNumbersView::OnDraw(CDC* pDC) { CNumbersDoc* pDoc = GetDocument(); ASSERT_VALID(pDoc); // TODO: add draw code for native data here short x = 0; short y = 1; int counter = 1; CString new1 = ""; CString new2 =""; do { new1.Format("%ld", x); new2.Format("%ld", y); pDoc->data1 pDoc->data1 pDoc->data1 pDoc->data1 x+=y; y+=x; counter +=2; } while do { new1.Format("%ld", x); new2.Format("%ld", y); pDoc->data2 pDoc->data2 pDoc->data2 pDoc->data2 x+=y; y+=x; counter +=2; += += += += new1; " "; new2; " "; (counter < 10); += += += += new1; " "; new2; " "; //Declare variables to //format the values as //text. //Use post-test loop //Format values of x, y //Concatenate to string //Add 3 spaces //Change value of x,y //Changes loop //condition to //terminate loop. //This post-test loop //concatenates values //into data2

srebmun iccanobiF yalpsid ot pool tset-tsoP :9 ytivitcA

} while ((counter < 20) && (counter >= 10)); pDC->TextOut(0, 0, pDoc->data); pDC->TextOut(0, 20, pDoc->data1); pDC->TextOut(0, 40, pDoc->data2); }

//Displays strings on //screen each string //on a new line.

.elbat semit hcae rof enil wen a htiw 21 1 morf selbat semit eht yalpsid ot spool roF detsen sesu taht margorp a etirW

void ClearnTablesView::OnDraw(CDC* pDC) { CLearnTablesDoc* pDoc = GetDocument(); ASSERT_VALID(pDoc); // TODO: add draw code for native data here int i; int j; int y = 0; CString convert = ""; for(i=0; i<12; i++) { pDoc->line = ""; for(j=0; j<12; j++) { convert.Format("%d", ((i+1)*(j+1))); pDoc->line+= convert; pDoc->line+=" "; } pDC->TextOut(0,y, pDoc->line); y+=20; } }

ot edoc gniwollof eht dda dna )

.xebyS :ocsicnarF naS .emit drocer ni ++C lausiV .)8991( S ,renzloH

.ppc.weiVselbaTnraeL ( ppc.coDselbaTnrael ni ezilaitnI

.h.coDselbaTnraeL ni ,

,elbairav gnirtSC a eralceD

.selbaTnraeL deman )exe(draziWppACFM htiw tcejorp elgnis wen a nepO

spooL ROF detseN :01 ytivitcA

.nur dna dliuB


line line = ;

yhpargoilbiB

drofpmaS yelreveB

yb deraperp saw krow sihT

mth.golatac/ten.de-eerf.www//:ptth :golataC esruoC teN dE-eerF .tteltraB dna senoJ :sttesuhcassaM ,yrubduS .++C htiw gnivloS melborP dna gnimmargorP .)0002( .srehto dna N ,elaD

secruoseR rehtruF

Potrebbero piacerti anche