2ND Quiz of CP II 4th Semester
Quiz A Q1: Ans:
HOW MANY WAYS ARE THERE IN MS VC++6 TO CREATE A PEN FOR THE GRAPHICAL DEVICE? Three ways.
Q2: Ans:
LIST NAMES OF THE FIELDS OF THE LOGPEN STRUCTURE AND THEIR USE WITH REFERENCE TO GD PEN. lognstyle (for line style), lopnwidth.x (for line width along x-direction), lopnwidth.y (for line width along y-direction) and lopncolor (for line color specified by RGB function).
Q3:
WRITE CODE THAT CAN BE ADDED IN ONDRAW (CDC* PDC) FUNCTION TO DISPLAY A LINE BETWEEN TWO POINTS ON THE CLIENT AREA OF THE SCREEN NAMELY (20, 30) AND (100, 140) IN BLUE DOTTED LINE. CPen bluepen (PS_SOLID, 1, RGB (0, 0, 255)); pDC->MoveTo(20, 30); pDC->LineTo(100, 140);
Ans:
Quiz B Q1: Ans: Q2: Ans: Q3: Ans:
WHAT CLASS OF THE MFC .EXE PROJECT IS RESPONSIBLE TO MANAGE THE STORAGE OF THE DOCUMENT MODEL OF THE USER'S WORK? C………Doc Class WHICH FUNCTION OF THE ABOVE-ASKED CLASS HOLDS CODE TO MANAGE THE TASK OF SAVING AND LOADING THE PREVIOUS WORK OF THE USER OF THE MFC .EXE PROJECT SOFTWARE? Serialize Function i.e. void C…….Doc::Serialize(Archive&ar); WRITE CODE THAT CAN BE ADDED IN ONDRAW (CDC* PDC) FUNCTION TO DISPLAY A LINE BETWEEN TWO POINTS ON THE CLIENT AREA OF THE SCREEN NAMELY (60, 70) AND (110, 300) IN RED DASHED LINE. CPen redpen (PS_DASH, 1, RGB (255, 0, 0)); pDC->MoveTo(60, 70); pDC->LineTo(110, 300);
Quiz C Q1:
HOW CAN WE ACCESS THE DATA MEMBERS OF THE DOCUMENT CLASS IN FUNCTION OTHER THAN ONDRAW (.......)? WRITE REQUIRED ONE LINE CODE AND EXPLAIN THE ITEMS OF THE CODE.
Ans: Q2: Ans:
Q3: Ans:
HOW CAN WE MAKE AN MFC .EXE PROJECT SOFTWARE TO ASK FOR SAVING OF THE USER'S WORK BEFORE THE SOFTWARE COMPLETELY CLOSES. WRITE ONE LINE OF CODE. By using a built in function, SetModifiedFlag(). As it a member function of C…….Doc class so for calling that function we require Pointer of Document class. i.e. PDoc->SetModifiedFlag(); WRITE CODE THAT CAN BE ADDED IN ONDRAW (CDC* PDC) FUNCTION TO DISPLAY A LINE BETWEEN TWO POINTS ON THE CLIENT AREA OF THE SCREEN NAMELY (61, 71) AND (111, 301) IN BLUE COLOR SOLID LINE THICKNESS OF TWO PIXELS. CPen bluepen (PS_SOLID, 2, RGB (0, 0, 255)); pDC->MoveTo(61, 71); pDC->LineTo(111, 301); For more detail consult notes.