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

What is the base class for MFC Framework ?

2 Answers   Mphasis,


What view class enables you to use an edit control as a view?

1 Answers  


How can server communicate with more than one client

2 Answers   Invensys,


What is the difference between the Encapsulation and Abstraction

25 Answers   HCL, Invensys, TCS, Wipro,


Tell me the different controls in MFC ?

5 Answers  


If i derive a new class from CObject what are the basic features my derived wil get ?

4 Answers   Microsoft,


How can update edit control data of an executing application from other application?

3 Answers   HP,


what is functioning of DIalodDataXchange ..?

0 Answers  


How to handle dynamic menus in mfc? What happens when client calls cocreateinstance?

0 Answers  


WHAT IS DIFFERENT BETWEN RELEASE MODE & DEBUGGING MODE

4 Answers   Google, Microsoft, TCS,


What is the use of UpdateData funciton ?

7 Answers  


Types of DLL's

11 Answers   Invensys,


Categories