Notice
Recent Posts
Recent Comments
Link
Lumiroot
MFC 객체간 통신
프로그램을 작성하다 보면 각 클래스들의 포인터가 필요한 경우가 있습니다. 다음과 같은 방법을 사용하면 각 클래스의 포인터를 얻을 수 있습니다. App App는 전역변수로 theApp라고 선언되어 있습니다. 만약 이를 사용하고자 한다면 Myprog.h파일의 끝부분에 extern CMyprogApp theApp; 라고 선언하면 프로그램의 어디서든 사용가능합니다. AfxGetApp()라는 함수를 사용하면 App의 포인터를 얻을 수 있습니다. CMyprogView * pView = (CMyprogView *)(pFrame -> GetActiveView ()); CMyprogDoc *pDoc = pView -> GetDocument (); dlg 에서 Doc pointer 얻는 방법 GetParent () -> ..
Programming/MFC
2008. 10. 2. 21:01