After these days of use VS, found that in fact, and VB still have some of the same place, so for the control still can well understand their role.
This is today on the machine to write a "cuboid solution" program, mainly more practice, familiar with.
Create a "Bank" project, in Bankget.h, create a class:
Class Bank{private:int Leight;int weight;int height;public:void get (int, int, int); int getarea (); int getvo ();};
In Bankget.cpp, complete the declaration of the built-in function:
#include "stdafx.h" #include "Bank.h" #include "bankget.h" void bank::get (int l, int w, int h) {leight = L;weight = W;height = H;} int Bank::getarea () {return (2 * (leight*weight + weight*height + leight*height));} int Bank::getvo () {return (leight*height*weight);}
In BankDlg.cpp, increase the function implementation of button buttons:
void Cbankdlg::onbnclickedbutton1 () {updatedata (); Bank B1;b1.get (b_l, B_w, b_h); B_area = B1.getarea (); b_vo = B1.getvo (); UpdateData (false);}
Results
@ Mayuko
Seventh Week item 2-optional graphical user interface program development