Answers

Question and Answer:

  Home  MFC

⟩ Visual Programming c++ coding for create a paint application?

class myframe:public CFrameWnd

{

public:

myframe()

{

Create(NULL,"My Paint application");

}

void OnPaint()

{

CPaintDC d(this);

CBrush mybrush(RGB(0,255,0));

d.SelectObject(&mybrush);

d.Rectangle(50,150,150,50);

}

DECLARE_MESSAGE_MAP()

};

BEGIN_MESSAGE_MAP(myframe,CFrameWnd)

ON_WM_PAINT()

END_MESSAGE_MAP()

class myapp:public CWinApp

{

public:

int InitInstance()

{

myframe *p=new myframe;

p->ShowWindow(1);

m_pMainWnd=p;

return 1;

}

};

myapp a;

 173 views

More Questions for you: