본문 바로가기

반응형

학습공간/C++, MFC

(4)

[MFC] Modeless Dialog (대화상자), 계산기 프로그램 Windows Form 형식이나 Dialog 형식에서 자주 쓰이는 모달과 모달리스 대화상자 기능에 대해 실습한다. 모달(Modal) 다이얼로그를 열게 되면 팝업을 띄운 부모객체 바깥쪽은 모두 Freezing 되어 제어권이 없다. 해당 대화상자의 Action 버튼이 반드시 실행된 후 다음 Action으로 넘어갈 때 사용하게 된다. 모달리스(Modeless) 다이얼로그는 부모객체의 제어권으로부터 자유롭다. 팝업을 띄우고 바깥쪽에서도 여러가지 Action 활동이 가능하다는 의미이다. 단, 자유에 따라 프로그램의 일관성을 유지해야 하므로 보다 섬세하게 접근해야 한다. 이번에는 모달리스(Modeless) 다이얼로그를 활용한 계산기 프로그램을 만들어 볼 것이다.
[3주차] 생성자와 소멸자, 멤버 함수의 활용, 클래스의 활용 (this) C++ 6단원 예제 1 // this-> 를 최대한 많이 씀 (인자와 변수를 구분하기위해) #include using namespace std; class Stack { public: int m_size; int m_top; int *m_buffer; void Initialize(int m_size = 10); void RemoveAll(); bool Push(int value); bool Pop(int& value); }; void Stack::Initialize(int m_size) { this->m_size = m_size; this->m_top = -1; this->m_buffer = new int[this->m_size]; memset(this->m_buffer, 0, sizeof(int) * ..
[2주차] 객체 지향 프로그래밍 시작하기, 클래스의 기초 (멤버변수) C++ 4단원 실습과제 1 #include #include using namespace std; int main() { string s1; s1 = "hello"; cout
[1주차] C++ 시작하기, C 보다 나은 C++ Ⅰ/Ⅱ(new, delete) C++ 2단원 실습과제 1 #include #include using namespace std; int strcmp(const char* s1, const char* s2); int GetMin(int x, int y) { return x
반응형