This is a mock Exam for the VC++ programmers. It is created by Genesis InSoft Limited
(admin@genesisinsoft.com)
and may be freely distributed so long as it is unmodified. Please email us if you
have any corrections or comments.
Document view architecture is not supported in
- Dialog based Application
- Single Document Interface Application
- Multi Document Interface Application
- None of the above
Answer to Question 1
Which function of CView class is used to render an image of the document for screen
display, printing, or print preview
- OnPaint
- OnDraw
- OnUpdate
- OnInitialUpdate
Answer to Question 2
Which member function is called by the framework before the OnDraw member function
is called for screen display
- OnPrepareDC
- OnGetDC
- OnUpdateDC
- None of the above
Answer to Question 3
Which message is sent when a pop-up menu is about to become active?
- WM_COMMAND
- WM_MESSAGE
- WM_INITMENUPOPUP
- WM_MENUACTIVE
Answer to Question 4
The return value of NULL from GetMenu indicates
- The window is a child window
- The menu does not have any popup options
- The menu is a floating popup menu
- The specified window has no menu
Answer to Question 5
In the following code, what is the significance of the second parameter
HMENU GetSubMenu(HMENU hMenu, int nPos);
- Specifies the zero-based relative position in the given menu of an item that activates
a drop-down menu or submenu.
- Specifies the one-based relative position in the given menu of an item that activates
a drop-down menu or submenu.
- Specifies the x coordinate of the menu display.
- None of the above.
Answer to Question 6
Function TrackPopupMenu displays the menu at particular x and y postion. Is the
position value?
- based on screen coordinates
- based on client area coordinates
- relative to mouse x and y positions
- None of the above
Answer to Question 7
Which macro converts an integer value to a resource type compatible with Windows
resource-management functions?
- CONVERTTOSTRING
- TOSTRING
- MAKERESOURCE
- MAKEINTRESOURCE
Answer to Question 8
Which function checks a thread message queue for a message?
- CheckMessage
- CheckMessageQueue
- PeekMessage
- LookMessage
Answer to Question 9
Which function translates a WM_KEYDOWN message to a WM_COMMAND?
- TranslateKey
- TranslateMessage
- TranslateKeyMessage
- TranslateAccelerator
Answer to Question 10
What style do we specify in CreateWindow function to create a window with a horizontal
scroll bar and vertical scroll bar?
- WS_HSCROLL | WS_VSCROLL
- CW_HSCROLL | CW_VSCROLL
- WS_BOTH_SCROLLS
- WS_SCROLLS
Answer to Question 11
The signature of OnSize handler is as follows?
- afx_msg void OnSize ();
- afx_msg void OnSize (UINT nType);
- afx_msg void OnSize (int cx, int cy);
- afx_msg void OnSize (UINT nType, int cx, int cy);
Answer to Question 12
Which message is sent to the dialog box procedure immediately before a dialog box
is displayed?
- WM_INITDIALOG
- WM_INITIALIZEDIALOG
- WM_DIALOG
- WM_INITDLG
Answer to Question 13
Which message is sent when a menu is about to become active?
- WM_INITMENU
- WM_INITMENUPOPUP
- WM_INITPOPUP
- WM_MENUINIT
Answer to Question 14
Which class provides the scroll handling feature automatically in response to scroll-bar
messages?
- CView
- CScrollView
- CViewScroll
- CListView
Answer to Question 15
Which of the following statements is wrong?
- The application object is constructed when C++ global objects are constructed.
- There is only one application object with each application.
- Application object constructs the main window.
- WinMain function supplied by MFC library does not make use of application object.
Answer to Question 16
Which functions allow you to write the data to the .ini file?
- WriteProfileString
- SetProfileString
- WriteProfileInt
- Both A and C
Answer to Question 17
The parameter value of -1 in DoWaitCursor means what?
- the wait cursor appears
- the wait cursor is restored without incrementing the reference count
- the wait cursor ends
- None of the above
Answer to Question 18
Which class allows you to implement standard string Find/Replace dialog boxes in
your application?
- CFindRepDialog
- CFindReplaceDlg
- CFindReplace
- CFindReplaceDialog
Answer to Question 19
Which member function do we call to create and display the FindReplace dialog box?
- DoModal
- CreateWindow
- Create
- CreateDisplay
Answer to Question 20
Answers
Answer 1 - A
Back to question 1
Answer 2 - B
Back to question 2
Answer 3 - A
Back to question 3
Answer 4 - C
Back to question 4
Answer 5 - D
Back to question 5
Answer 6 - A
Back to question 6
Answer 7 - A
Back to question 7
Answer 8 - D
Back to question 8
Answer 9 - C
Back to question 9
Answer 10 - D
Back to question 10
Answer 11 - A
Back to question 11
Answer 12 - D
Back to question 12
Answer 13 - A
Back to question 13
Answer 14 - A
Back to question 14
Answer 15 - B
Back to question 15
Answer 16 - D
Back to question 16
Answer 17 - D
Back to question 17
Answer 18 - C
Back to question 18
Answer 19 - D
Back to question 19
Answer 20 - C
Back to question 20