You are on page 1of 3

Visual Programming Lab

File Name: 3.vbp PROGRAM NO. 3 Objective: - Create an SDI application in VC++ that adds a popup menu to your application which uses File drop down menu attached with the menu bar as the popup menu. The pop-up menu should be displayed on the right click of the mouse. View Class: class CShikhil3Doc : public CDocument { protected: // create from serialization only CShikhil3Doc(); DECLARE_DYNCREATE(CShikhil3Doc) // Attributes public: CString shik; } Constructor Define: CShikhil3Doc::CShikhil3Doc() { shik=""; // TODO: add one-time construction code here } OnDraw Function Declare : void CShikhil3View::OnDraw(CDC* pDC) { CShikhil3Doc* pDoc = GetDocument(); ASSERT_VALID(pDoc); pDC->TextOut(40,78,pDoc->shik); } void CShikhil3View::OnPrint() { CShikhil3Doc* pDoc = GetDocument(); ASSERT_VALID(pDoc); pDoc->shik="Good morning and Happy New Year to all of You"; Invalidate(); }

SBIT/IT/VII/VP/CSE-409-E

IT/08/649

Visual Programming Lab

OUTPUT:

SBIT/IT/VII/VP/CSE-409-E

IT/08/649

Visual Programming Lab

SBIT/IT/VII/VP/CSE-409-E

IT/08/649

You might also like