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

Whats is DDX & DDV in MFC?

1 Answers   HCL,


What is the difference between the SDI and MDI

3 Answers   Invensys,


What are the special requirements for dialog box resources used in a form view?

2 Answers  


1)how to Display the File Dialog Box, in MFC ?

1 Answers  


1)To Remove WS_MINIMIZEBOX in a Frame ?

1 Answers  






What is userdefine Messages in MFC?

1 Answers   HCL,


What is the difference between the Encapsulation and Abstraction

25 Answers   HCL, Invensys, TCS, Wipro,


is it possible to display a window .without using windowclass

1 Answers   E Logic,


1) Enable or disable a Cancel button at run time?

1 Answers   HCL,


I have 2 threads. One thread prints odd numbers and the second thread prints even numbers. Now, I have to execute the threads alternatively so that i can output 1,2,3,4,5,6,..... write code for this?

1 Answers  


What is the difference between GetMessage and PeekMessage ?

3 Answers  


What is the size of class

18 Answers   Aircom,


Categories