visual Pogramming c++ coding for create a paint application..
(Please someone help me)

Answers were Sorted based on User's Feedback



visual Pogramming c++ coding for create a paint application.. (Please someone help me)..

Answer / jack

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;

Is This Answer Correct ?    7 Yes 0 No

visual Pogramming c++ coding for create a paint application.. (Please someone help me)..

Answer / deepa

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;

Is This Answer Correct ?    2 Yes 0 No

Post New Answer

More MFC Interview Questions

Explain StretchBlt and BitBlt

1 Answers  


Which CPrintInfo member variable must be set for multiple page printouts?

1 Answers  


if no message handler is available for a message then will deal with the message ? does window proving any default mechanism?

2 Answers   Patni,


If there is more than 100 control in a window how we can change the Taborder of a controls

4 Answers   Satyam,


What four types of properties are supported by an ActiveX control?

1 Answers  


what is the difference between compiling and building?

1 Answers  


What is document-view architecture ? Give me one real time example for SDI ?

2 Answers  


what message is sent to an application when the user presses the primary button?

0 Answers   University Exams,


Why Array Index starts from Zero

30 Answers   HCL,


Which MFC function is used to display output?

9 Answers   TCS,


What is the use of CCmdTarget ?

4 Answers  


is there any class which is not derived from Cobject

11 Answers   Patni,


Categories