Win32 API MFC VCPP header banner

110 Exam and interview questions on WIN32, MFC and C/C++ under Windows for developers/learners. Click on the link to get the detailed explanations. One you visit any answer you can navigate through next and previous link to jump from one answer to another. You can also select index to come back to this index page. Please provide us the rating and feedbacks of our questions and answers.

  1. How windows differs from DOS and what is the advantage of GUI based program? answer
  2. What is SDK and API functions? answer
  3. Why in windows programming, we never access hardware directly instead we use windows API, where as in DOS we directly access hardware? answer
  4. What are the basic DLL components of Windows and what are their functionalities? answer
  5. What is WinMain() function entry in Windows Applications and what is its prototype? answer
  6. What is a Window CallBack procedure and what is its utility? answer
  7. What are the calling conventions and how PASCAL, CALLBACK, WINAPI differs with C/C++ function calls? answer
  8. What are the basic steps of a typical windows program? answer
  9. What is the utility of calling DefWindowProc() function in CALLBACK window procedure? answer
  10. What are LPARAM and WPARAM in window proc function and how Win32 subsystem pass parameters to this function? answer
  11. What are the members of MGS structure and utility of each members? answer
  12. How windows program handles message pump and how to exit from the loop? answer
  13. What is window class and what are common available window classes available in windows? answer
  14. How to define a custom window class and how to Register it? answer
  15. What is WM_PAINT event when it is called ? answer
  16. When we use BeginPaint and EndPaint and when to use GetDC() and ReleaseDC()? answer
  17. What is Device Context (DC) ? answer
  18. Why in windows programming we use API to interact with Device Context of screen and printer instead direct hardware calls to the device where as in DOS we directly interact with screen and printer? answer
  19. What is the difference between a GetDC() and GetWindowDC() call? answer
  20. What is windows client and non-client area? answer
  21. What are different mouse events? answer
  22. How we can get the co-ordinate of mouse during mouse events? answer
  23. What is non-client mouse event? And how can I determine on which object mouse has been clicked? answer
  24. What is unicode and international character/multi language support in windows? answer
  25. How can I convert a Unicode string to null terminated byte string and vise versa? answer
  26. What is string table and why it is used? answer
  27. In a typical MFC application we never write WinMain() function so how is it possible to compile and link a windows program with out WinMain()? answer
  28. What are the basic steps of a typical MFC based application? answer
  29. What is the base class of any MFC class? answer
  30. Explain the MFC class hierarchy starting from CObject? answer
  31. What is the utility of CWinApp class? answer
  32. Can I create multiple objects of my main application class CWinApp? answer
  33. What is the utility of CCmdTarget class in the MFC class hierarchy? answer
  34. m_pMainWnd is the member of which class in MFC class hierarchy? answer
  35. What is the class hierarchy tree of CWinApp class? answer
  36. How MFC uses event handling and what is the utility of DECLARE_MESSAGE_MAP(), BEGIN_MESSAGE_MAP() and END_MESSAGE_MAP() macro? answer
  37. Why MFC uses virtual functions for implementing very limited number of events? Why it does not use virtual functions for all event handling? answer
  38. What is UNICODE? answer
  39. How can we give all world wide language support to our application? answer
  40. Mention two major functions to convert ASCII string to UNICODE string and vise versa? answer
  41. What is the job of resource DLL in a project? answer
  42. What is PEN object in GDI? answer
  43. What are some basic styles of a PEN object? answer
  44. What is the utility of NULL PEN? answer
  45. What is BRUSH? answer
  46. What are different types of Brushes? answer
  47. What is the utility of NULL BRUSH? answer
  48. What is the difference between Screen DC and Printer DC? answer
  49. How SaveDC and RestoreDC works? answer
  50. What is RECT? answer
  51. What is Bitmap? And how can I draw a Bitmap? answer
  52. What is pallet? answer
  53. What is font? answer
  54. What are the types of fonts are there? answer
  55. What is MetaFile? How can I store and Retrieve drawing of a window? answer
  56. How can you use GetDeviceCaps(), GetSystemMetrics(), GetFontMetrics() functions to get system settings? answer
  57. What is carat? How we use it? answer
  58. How we use keyboard shortcuts in dialog and menu items? answer
  59. How can I load menu? answer
  60. How can load menu dynamically? answer
  61. How can I use one event function for a range of menu id? answer
  62. How can I use popup menu or a context menu? answer
  63. What is system menu and How can I append extra menu in system menu? answer
  64. What is 'Modal' and 'Modeless' Dialog? Give example and state their uses. answer
  65. How can I create modeless dialog? answer
  66. How can I create a dialog in the middle of Desktop? answer
  67. What are the different member of CDataExchange class? answer
  68. How data and the text in the dialog screen are exchanged in DoDataExchange() routine? answer
  69. What are the result of UpdateData(TRUE) and UpdateData(FALSE) call? answer
  70. What are the suitable variable types for the data exchange to and from a Edit, Check Box, Radio Button, List and Combobox? Can a CString be used for the List Box. answer
  71. How data are validated in data exchange routine? answer
  72. How can I change the text of the message box that comes for the data validation? answer
  73. What is property sheet and property page? answer
  74. How property sheet and page classes works internally? answer
  75. How can I color background of Edit and Static and other controls? answer
  76. How can I set a timer? answer
  77. How can I read or modify windows clipboard? answer
  78. Why Tree and List control are called view control? answer
  79. What is a Image List? answer
  80. What are the types of views supported in ListView? answer
  81. What are the different types of common dialogs? answer
  82. How can I customize a File Open Dialog? answer
  83. Is FindReplace dialog is modal or modeless? Why? answer
  84. What are different types of open mode in CFile? answer
  85. What is the advantage of using CStudioFile class over CFile? answer
  86. How can I open a file on drag-n-drop operation? answer
  87. How can I write a class that supports serializtion? answer
  88. What is the utility of serialization? answer
  89. Does serialization is only used for storing or retrieving information to and from disk filesystem? answer
  90. What is CArchive class in serialization routine? Why a CFile is not used here? answer
  91. What is worker thread and UI thread? answer
  92. How can I create a worker thread using AfxBeginThread() function? answer
  93. How can I create an UI thread using MFC? answer
  94. What are the different synchonization classes provided by MFC? answer
  95. How can I modify attribute of Frame window before creation? answer
  96. What is the Doc/View architecture in MFC? Explain. answer
  97. What is CRuntime class? Where it is used? answer
  98. What is a MFC class that supports dynamic creation? answer
  99. How a MFC class can support RTTI? answer
  100. What is the utility of IMPLEMENT_DYNAMIC? answer
  101. Why in Doc/view classes are created dynamically? answer
  102. How can I construct a Single Document Templete class? answer
  103. Describe workflow of a typical MFC Application that supports Doc/View? answer
  104. How messages are routed in an Doc/View application? answer
  105. What is the utility of OnDraw() function in CView class in Doc/View? answer
  106. How command line arguments are processed in Doc/View? answer
  107. What is the difference between SDI and MDI Application? answer
  108. How can I split a CFrameWnd? answer
  109. What are the sequence of a OnFilePrint() event? answer

Topic Discussed: GUI based program, SDK and API, DLL components, WinMain(), CallBack, calling conventions,PASCAL, CALLBACK, WINAPI, DefWindowProc(), LPARAM and WPARAM, MGS, message pump, window class, Register, WM_PAINT, BeginPaint, EndPaint, GetDC(), ReleaseDC(), Device Context, GetDC() and GetWindowDC(), client and non-client area, mouse events, unicode and international character/multi language support, string table, MFC application, CWinApp, CCmdTarget, m_pMainWnd, DECLARE_MESSAGE_MAP(), BEGIN_MESSAGE_MAP() and END_MESSAGE_MAP() , resource DLL, GDI, PEN, BRUSH, SaveDC, RECT, Bitmap, pallet, font, MetaFile, GetDeviceCaps(), GetSystemMetrics(), GetFontMetrics(), carat, menu, context menu, "Modal" and "Modeless" Dialog, CDataExchange, DoDataExchange(), UpdateData(), property sheet and property page, timer, clipboard, view control, Image List, common dialogs, File Open Dialog FindReplace, CStudioFile, drag-n-drop, serializtion, CArchive, worker thread and UI thread, AfxBeginThread(), synchonization, Frame, Doc/View, CRuntime class, RTTI, IMPLEMENT_DYNAMIC? CFrameWnd, OnFilePrint().