Visual C++ Question Bank / FAQs
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.
Question 1
The base class of CPaintDC class is
- CClientDC
- CWindowDC
- CDC
- CObject
Answer to Question 1
Question 2
A CPaintDC object can only be used when responding to which of the following message?
- WM_SIZE
- WM_CREATE
- WM_COMMAND
- WM_PAINT
Answer to Question 2
Question 3
Which function retrieves the device context (DC) for the entire window, including title
bar, menus, and scroll bars.
- GetDC
- BeginPaint
- GetWindowDC
- All of the above
Answer to Question 3
Question 4
RegisterClass function takes a pointer to the following structure?
- MSG
- WNDCLASS
- PAINTSTRUCT
- WNDCLASSEX
Answer to Question 4
Question 5
Which class performs a CWnd::BeginPaint at construction time and CWnd::EndPaint at
destruction time.
- CPaintDC
- CClientDC
- CDC
- CMetaFileDC
Answer to Question 5
Question 6
Which data members are defined in CWinApp class?
- m_nCmdShow, m_hInstance
- m_pszAppName
- m_pActiveWnd, m_pszExeName
- All of the above
Answer to Question 6
Question 7
Which member function can we override in an application to provide a customized message
loop?
- InitInstance
- Run
- ExitInstance
- OnIdle
Answer to Question 7
Question 8
What is the initial value of nCmdShow of AfxWinMain?
- SW_SHOW
- SW_NORMAL
- SW_SHOWMAXIMIZED
- It depends on the operating system.
Answer to Question 8
Question 9
Which function displays a floating pop-up menu at the specified location?
- CreatePopupMenu
- TrackPopupMenu
- GetSubMenu
- FloatMenu
Answer to Question 9
Question 10
Which function clears all the contents of the list box or combo box?
- DeleteAll
- ClearAll
- ResetContent
- DeleteItems
Answer to Question 10
Question 11
Which function of edit control allows you to set the password character?
- SetPassword
- SetPasswordItem
- SetPasswordChars
- SetPasswordChar
Answer to Question 11
Question 12
Which function retrieves the check state of a button control?
- GetState
- GetCheck
- GetButtonCheck
- GetValue
Answer to Question 12
Question 13
Which scrollbar function allows you to set the page size?
- SetScrollRange
- SetRange
- SetPageSize
- SetScrollInfo
Answer to Question 13
Question 14
Which member function of CProgressCtrl advances the current position by the step
increment?
- SetStep
- MoveIt
- StepIt
- UpdateIt
Answer to Question 14
Question 15
The base class of CDocument is?
- CCmdTarget
- CObject
- CWinThread
- None of the above
Answer to Question 15
Question 16
Which function sets a flag indicating that you have modified the document since it was
last saved?
- SetModified
- IsModified
- SetModifiedFlag
- UpdateData
Answer to Question 16
Question 17
Which functions returns the document associated with the view?
- GetViewDocument
- GetDocument
- GetDocuments
- GetCurDocument
Answer to Question 17
Question 18
Which of the following statement is wrong?
- One document can have multiple views
- One view can have multiple documents
- In SDI the main frame window is derived from class CFrameWnd
- In MDI the main frame window is derived from class CMDIFrameWnd
Answer to Question 18
Question 19
What is the base class of CFileDialog?
- CDialog
- CWnd
- CCommonDialog
- CCommonDlg
Answer to Question 19
Question 20
Which member function returns the full path of the selected file of CFileDialog?
- GetPathName
- GetFileName
- GetPathFileName
- GetFullPath
Answer to Question 20
Answers
Answer 1 - C
Back to question 1
Answer 2 - D
Back to question 2
Answer 3 - C
Back to question 3
Answer 4 - B
Back to question 4
Answer 5 - A
Back to question 5
Answer 6 - D
Back to question 6
Answer 7 - B
Back to question 7
Answer 8 - D
Back to question 8
Answer 9 - B
Back to question 9
Answer 10 - C
Back to question 10
Answer 11 - D
Back to question 11
Answer 12 - B
Back to question 12
Answer 13 - D
Back to question 13
Answer 14 - C
Answer 15 - A
Back to question 15
Answer 16 - C
Back to question 16
Answer 17 - B
Answer 18 - B
Answer 19 - C
Back to question 19
Answer 20 - A
Back to question 20
|