Wednesday, August 4, 2010

Visual C++ - Set 1-2

Question 1

The base class of CPaintDC class is

  1. CClientDC
  2. CWindowDC
  3. CDC
  4. CObject

Question 2

A CPaintDC object can only be used when responding to which of the following message?

  1. WM_SIZE
  2. WM_CREATE
  3. WM_COMMAND
  4. WM_PAINT

Question 3

Which function retrieves the device context (DC) for the entire window, including title bar, menus, and scroll bars.

  1. GetDC
  2. BeginPaint
  3. GetWindowDC
  4. All of the above

Question 4

RegisterClass function takes a pointer to the following structure?

  1. MSG
  2. WNDCLASS
  3. PAINTSTRUCT
  4. WNDCLASSEX

Question 5

Which class performs a CWnd::BeginPaint at construction time and CWnd::EndPaint at destruction time.

  1. CPaintDC
  2. CClientDC
  3. CDC
  4. CMetaFileDC

Question 6

Which data members are defined in CWinApp class?

  1. m_nCmdShow, m_hInstance
  2. m_pszAppName
  3. m_pActiveWnd, m_pszExeName
  4. All of the above

Question 7

Which member function can we override in an application to provide a customized message loop?

  1. InitInstance
  2. Run
  3. ExitInstance
  4. OnIdle

Question 8

What is the initial value of nCmdShow of AfxWinMain?

  1. SW_SHOW
  2. SW_NORMAL
  3. SW_SHOWMAXIMIZED
  4. It depends on the operating system.

Question 9

Which function displays a floating pop-up menu at the specified location?

  1. CreatePopupMenu
  2. TrackPopupMenu
  3. GetSubMenu
  4. FloatMenu

Question 10

Which function clears all the contents of the list box or combo box?

  1. DeleteAll
  2. ClearAll
  3. ResetContent
  4. DeleteItems

Question 11

Which function of edit control allows you to set the password character?

  1. SetPassword
  2. SetPasswordItem
  3. SetPasswordChars
  4. SetPasswordChar

Question 12

Which function retrieves the check state of a button control?

  1. GetState
  2. GetCheck
  3. GetButtonCheck
  4. GetValue

Question 13

Which scrollbar function allows you to set the page size?

  1. SetScrollRange
  2. SetRange
  3. SetPageSize
  4. SetScrollInfo

Question 14

Which member function of CProgressCtrl advances the current position by the step increment?

  1. SetStep
  2. MoveIt
  3. StepIt
  4. UpdateIt

Question 15

The base class of CDocument is?

  1. CCmdTarget
  2. CObject
  3. CWinThread
  4. None of the above

Question 16

Which function sets a flag indicating that you have modified the document since it was last saved?

  1. SetModified
  2. IsModified
  3. SetModifiedFlag
  4. UpdateData

Question 17

Which functions returns the document associated with the view?

  1. GetViewDocument
  2. GetDocument
  3. GetDocuments
  4. GetCurDocument

Question 18

Which of the following statement is wrong?

  1. One document can have multiple views
  2. One view can have multiple documents
  3. In SDI the main frame window is derived from class CFrameWnd
  4. In MDI the main frame window is derived from class CMDIFrameWnd

Question 19

What is the base class of CFileDialog?

  1. CDialog
  2. CWnd
  3. CCommonDialog
  4. CCommonDlg

Question 20

Which member function returns the full path of the selected file of CFileDialog?

  1. GetPathName
  2. GetFileName
  3. GetPathFileName
  4. GetFullPath

 

Answers

Answer 1 - C

Answer 2 - D

Answer 3 - C

Answer 4 - B

Answer 5 - A

Answer 6 - D

Answer 7 - B

Answer 8 - D

Answer 9 - B

Answer 10 - C

Answer 11 - D

Answer 12 - B

Answer 13 - D

Answer 14 - C

Answer 15 - A

Answer 16 - C

Answer 17 - B

Answer 18 - B

Answer 19 - C

Answer 20 - A

No comments:

Post a Comment