class MyView : public CView { public: virtual void OnDraw(CDC* pDC) { // draw code here } };
class MyFrame : public CFrameWnd { public: MyFrame() { // initialize frame code here Create(NULL, "My App"); pMyView = new MyView(); SetView(pMyView); } MyView* pMyView; };This example creates a new class MyFrame that inherits from CFrameWnd. It creates an instance of MyView and sets it as the active view within the frame. These code examples belong to the MFC library package, which is a set of C++ classes and functions that provide a framework for developing Windows applications.