Draw House Example Program In VC++

#include<afxwin.h>
#include<afxext.h>

class Frame : public CFrameWnd {
public:
Frame() {
      Create(0, "House");
   }

   void OnPaint() {
      CPaintDC Obj(this);
      CPen RPen, BPen, GPen;

      RPen.CreatePen(0, 2, RGB(255, 0, 0));
      BPen.CreatePen(0, 1, RGB(0, 255, 0));
      GPen.CreatePen(0, 4, RGB(0, 0, 255));

      Obj.SelectObject(&GPen);
      Obj.Rectangle(300, 300, 500, 500);
      Obj.MoveTo(300, 300);
      Obj.LineTo(400, 200);
      Obj.LineTo(500, 300);

      Obj.SelectObject(&BPen);
      Obj.Rectangle(400, 350, 460, 480);

      Obj.SelectObject(&RPen);
      Obj.Ellipse(100, 100, 150, 150);

   }

   DECLARE_MESSAGE_MAP()
};

BEGIN_MESSAGE_MAP(Frame, CFrameWnd)
ON_WM_CREATE()
ON_WM_PAINT()
END_MESSAGE_MAP()


class Applet : public CWinApp {
public:

   int InitInstance() {
      Frame *Pointer = new Frame();
      Pointer->ShowWindow(3);
      m_pMainWnd = Pointer;
      return true;
   }
};

Applet Instance;