Wednesday, August 4, 2010

Visual C++ - Set 1-1

Question 1
Document view architecture is not supported in
  1. Dialog based Application
  2. Single Document Interface Application
  3. Multi Document Interface Application
  4. None of the above
Question 2
Which function of CView class is used to render an image of the document for screen display, printing, or print preview
  1. OnPaint
  2. OnDraw
  3. OnUpdate
  4. OnInitialUpdate
Question 3
Which member function is called by the framework before the OnDraw member function is called for screen display
  1. OnPrepareDC
  2. OnGetDC
  3. OnUpdateDC
  4. None of the above
Question 4
Which message is sent when a pop-up menu is about to become active?
  1. WM_COMMAND
  2. WM_MESSAGE
  3. WM_INITMENUPOPUP
  4. WM_MENUACTIVE
Question 5
The return value of NULL from GetMenu indicates
  1. The window is a child window
  2. The menu does not have any popup options
  3. The menu is a floating popup menu
  4. The specified window has no menu
Question 6
In the following code, what is the significance of the second parameter

HMENU GetSubMenu(HMENU hMenu, int nPos);
  1. Specifies the zero-based relative position in the given menu of an item that activates a drop-down menu or submenu.
  2. Specifies the one-based relative position in the given menu of an item that activates a drop-down menu or submenu.
  3. Specifies the x coordinate of the menu display.
  4. None of the above.
Question 7
Function TrackPopupMenu displays the menu at particular x and y postion. Is the position value?
  1. based on screen coordinates
  2. based on client area coordinates
  3. relative to mouse x and y positions
  4. None of the above
Question 8
Which macro converts an integer value to a resource type compatible with Windows resource-management functions?
  1. CONVERTTOSTRING
  2. TOSTRING
  3. MAKERESOURCE
  4. MAKEINTRESOURCE
Question 9
Which function checks a thread message queue for a message?
  1. CheckMessage
  2. CheckMessageQueue
  3. PeekMessage
  4. LookMessage
Question 10
Which function translates a WM_KEYDOWN message to a WM_COMMAND?
  1. TranslateKey
  2. TranslateMessage
  3. TranslateKeyMessage
  4. TranslateAccelerator
Question 11
What style do we specify in CreateWindow function to create a window with a horizontal scroll bar and vertical scroll bar?
  1. WS_HSCROLL | WS_VSCROLL
  2. CW_HSCROLL | CW_VSCROLL
  3. WS_BOTH_SCROLLS
  4. WS_SCROLLS
Question 12
The signature of OnSize handler is as follows?
  1. afx_msg void OnSize ();
  2. afx_msg void OnSize (UINT nType);
  3. afx_msg void OnSize (int cx, int cy);
  4. afx_msg void OnSize (UINT nType, int cx, int cy);
Question 13
Which message is sent to the dialog box procedure immediately before a dialog box is displayed?
  1. WM_INITDIALOG
  2. WM_INITIALIZEDIALOG
  3. WM_DIALOG
  4. WM_INITDLG
Question 14
Which message is sent when a menu is about to become active?
  1. WM_INITMENU
  2. WM_INITMENUPOPUP
  3. WM_INITPOPUP
  4. WM_MENUINIT
Question 15
Which class provides the scroll handling feature automatically in response to scroll-bar messages?
  1. CView
  2. CScrollView
  3. CViewScroll
  4. CListView
Question 16
Which of the following statements is wrong?
  1. The application object is constructed when C++ global objects are constructed.
  2. There is only one application object with each application.
  3. Application object constructs the main window.
  4. WinMain function supplied by MFC library does not make use of application object.
Question 17
Which functions allow you to write the data to the .ini file?
  1. WriteProfileString
  2. SetProfileString
  3. WriteProfileInt
  4. Both A and C
Question 18
The parameter value of -1 in DoWaitCursor means what?
  1. the wait cursor appears
  2. the wait cursor is restored without incrementing the reference count
  3. the wait cursor ends
  4. None of the above
Question 19
Which class allows you to implement standard string Find/Replace dialog boxes in your application?
  1. CFindRepDialog
  2. CFindReplaceDlg
  3. CFindReplace
  4. CFindReplaceDialog
Question 20
Which member function do we call to create and display the FindReplace dialog box?
  1. DoModal
  2. CreateWindow
  3. Create
  4. CreateDisplay

Answers

Answer 1 - A

Answer 2 - B

Answer 3 - A

Answer 4 - C

Answer 5 - D

Answer 6 - A

Answer 7 - A

Answer 8 - D

Answer 9 - C

Answer 10 - D

Answer 11 - A

Answer 12 - D

Answer 13 - A

Answer 14 - A

Answer 15 - B

Answer 16 - D

Answer 17 - D

Answer 18 - C

Answer 19 - D

Answer 20 - C

No comments:

Post a Comment