Genesis Insoft The name you can TRUST
twitterlogo facebooklogo
Home  |  Contact Us |  Careers
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

Which of the following statements is correct?

  1. Windows is a callback programming model.
  2. In windows the end user controls the flow of program execution after the basic initialization is done.
  3. Windows is event driven and is non-linear model.
  4. All of the above

Answer to Question 1

Question 2

Which of the following statements is correct?

  1. A windows application terminates only when there is WM_END message in message queue.
  2. A windows application terminates only when there is WM_QUIT message in message queue.
  3. A windows application terminates only when there is WM_CLOSE message in message queue.
  4. A windows application terminates only when there is WM_DESTROY message in message queue.

Answer to Question 2

Question 3

Which of the following statements is correct about EndPaint function?

  1. It marks the end of painting in the specified window.
  2. It is required for each call to BeginPaint function.
  3. It should be called only after painting is complete.
  4. All of the above.

Answer to Question 3

Question 4

Significance of GetMessage function is

  1. Convert WM_KEYDOWN message into WM_CHAR
  2. Terminate when the message in calling thread's message queue is WM_END
  3. Retrieve a message from the calling thread’s message queue and places it in the specified structure
  4. Dispatch the message to the window procedure

Answer to Question 4

Question 5

The lparam of WM_TIMER procedure is

  1. Timer ID
  2. Pointer to an application-defined callback function that was passed to the SetTimer function when the timer was installed
  3. Time Interval
  4. None of the above

Answer to Question 5

Question 6

For the following code segment, select the correct statement.

CBrush MyBrush(HS_CROSS, RGB(0, 255, 0));
dc.SelectObject(&MyBrush);
dc.Rectangle(100, 100, 300, 250);

  1. Draws a rectangle of width 200, height 150 whose interior is filled with cross hatch style, green in color
  2. Draws a rectangle of width 200, height 150 and the interior is filled with solid green color
  3. Draws a rectangle of width 200, height 250 whose interior is filled with cross hatch style, green in color 
  4. Draws a rectangle of width 200, height 150 whose interior is filled with cross hatch style, green in color 

Answer to Question 6

Question 7

What is the base class of CWinApp?

  1. CAPP
  2. CCmdTarget
  3. CWinThread
  4. CObject

Answer to Question 7

Question 8

Which of the following is correct with respect to Select object?

  1. It selects the object into the specified device context. The new object replaces the previous object of the same type.
  2. It's return type is void.
  3. Information about the old object is not available for future use.
  4. It is used to select only pens and brushes into device context.

Answer to Question 8

Question 9

Which of the following is correct for DestroyWindow function?

  1. It destroys the specified window and terminates the application.
  2. It destroys the specified window and sends a WM_DESTROY message.
  3. It destroys modeless dialog boxes created by the CreateDialog function.
  4. Both B and C

Answer to Question 9

Question 10

To count the number of buttons on mouse, we use the following function

  1. GetSystemMetrics(SM_MOUSEPRESENT)
  2. GetSystemMetrics(SM_CMOUSEBUTTONS)
  3. GetFontMetrics()
  4. None of the above

Answer to Question 10

Question 11

To get information of the font we use the following statement?

  1. GetFontMetrics()
  2. GetTextMetrics()
  3. GetSystemMetrics(SM_FONTDATA)
  4. GetSystemMetrics(SM_FONTMETRICS)

Answer to Question 11

Question 12

The 3rd parameter of SetTimer function is?

  1. Time Interval
  2. Timer ID
  3. Long pointer to the function to be notified when the time-out value elapses
  4. Pointer to the OnTimer function

Answer to Question 12

Question 13

Given a child window control object, how do you get the ID of the control?

  1. GetID function
  2. GetDlgItem
  3. GetChildWndID
  4. GetDlgCtrlID

Answer to Question 13

Question 14

Which of the following statements is correct if the user clicks child window scrollbar?

  1. OnVScroll method's 3rd argument is NULL
  2. OnVScroll method's 3rd argument is a pointer to the control
  3. OnVScroll method's 1st argument refers to the current position of thumb track
  4. OnVScroll method's 2nd argument specifies a scroll-bar code that indicates a scrolling request by the user

Answer to Question 14

Question 15

When we execute the following code what does it result in, assuming rect is size of the window?

    DrawText(hdc, "Genesis", -1, &rect, DT_CENTER | DT_VCENTER);

  1. Displays the last character of text "Genesis" in the center of the window horizontally
  2. Displays the last character of text "Genesis" in the center of the window both horizontally and vertically
  3. Displays the text "Genesis" in the center of the window both horizontally and vertically
  4. Displays the text "Genesis" in the center of the window horizontally

Answer to Question 15

Question 16

When we execute the following code what does it result in?

    TextOut(hdc, 100, 125, "Genesis InSoft", -1);

  1. Displays the text "Genesis InSoft" at logical x and y coordinates
  2. Displays the text "Genesis" at logical x and y coordinates
  3. Displays the text "Genesis" at device x and y coordinates
  4. No text is displayed

Answer to Question 16

Question 17

Which of the following is correct about resources?

  1. They are stored with a file extension .rs
  2. They are stored with a file extension .rc
  3. The resource file when compiled results in .res
  4. Both B and C

Answer to Question 17

Question 18

The mapping mode MM_TEXT relates to

  1. X increases horizontally right and Y increases vertically down
  2. Each unit is one twips
  3. X increases horizontally right and Y increases vertically up
  4. Each unit is one cm

Answer to Question 18

Question 19

Invalidate(TRUE) does what?

  1. The background is erased when the BeginPaint function is called.
  2. The background is erased when the EndPaint function is called.
  3. The background is not erased when the BeginPaint function is called.
  4. The background is not erased when the EndPaint function is called.

Answer to Question 19

Question 20

CWnd::InvalidateRect(&rect) does what?

  1. Erases "rect" area and its child windows if any
  2. Erases entire client area and its child windows if any
  3. Erases "rect" area and does not repaint its child windows if any
  4. Erases entire client area and does not repaint its child windows if any

Answer to Question 20

Answers

Answer 1 - D

Back to question 1

Answer 2 - B

Back to question 2

Answer 3 - D

Back to question 3

Answer 4 - C

Back to question 4

Answer 5 - B

Back to question 5

Answer 6 - A

Back to question 6

Answer 7 - C

Back to question 7

Answer 8 - A

Back to question 8

Answer 9 - D

Back to question 9

Answer 10 - B

Back to question 10

Answer 11 - B

Back to question 11

Answer 12 - C

Back to question 12

Answer 13 - D

Back to question 13

Answer 14 - B

Back to question 14

Answer 15 - D

Back to question 15

Answer 16 - D

Back to question 16

Answer 17 - D

Back to question 17

Answer 18 - A

Back to question 18

Answer 19 - A

Back to question 19

Answer 20 - C

Back to question 20

Copyright © 2000 to 2011 Genesis InSoft Limited. All Rights Reserved.