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.

answer How windows differs from DOS and what is the advantage of GUI based program?

answer What is Windows SDK? What is Windows Win32 API functions?

answer Why in windows programming, we never access hardware directly instead we use windows API, where as in DOS we directly access hardware?

answer What are Basic DLL components of Windows? Functionalities of DLLs?

answer What is WinMain function in windows C? Main vs WinMain, WinMain prototype and arguments.

answer What is a Window CallBack procedure and what is its utility?

answer What are the calling conventions in C? How PASCAL, CALLBACK, WINAPI differs with C/C++ function calls?

answer Steps to write a basic window program with C and Win32 APIs.

answer What is the utility of calling DefWindowProc() function in CALLBACK window procedure?

answer What are LPARAM and WPARAM in window proc function ? How Win32 subsystem pass parameters to this function?

answer What are the members of MGS structure and utility of each members?

answer How windows program handles message pump and how to exit from the loop?

answer What is window class and what are common available window classes available in windows?

answer How to define a custom window class? Register and Create?

answer What is WM_PAINT event ? When does Win32 subsystem call WM_PAINT event?

answer When we use BeginPaint and EndPaint and when to use GetDC() and ReleaseDC()?

answer What is Device Context (DC) in Windows?

answer 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 What is the difference between a GetDC() and GetWindowDC() call?

answer What is windows client and non-client area?

answer What are different mouse events?

answer How we can get the co-ordinate of mouse during mouse events?

answer What is non-client mouse event? And how can I determine on which object mouse has been clicked?

answer What is unicode and international character/multi language support in windows?

answer How can I convert a Unicode string to null terminated byte string and vise versa?

answer What is string table in resources ? What is the purpose of string table w.r.t. multi language support?

answer 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 What are the basic steps of a typical MFC based application?

answer What is the base class of any MFC class?

answer Explain the MFC class hierarchy starting from CObject?

answer What is the utility of CWinApp class?

answer Can I create multiple objects of my main application class CWinApp?

answer What is the utility of CCmdTarget class in the MFC class hierarchy?

answer m_pMainWnd is the member of which class in MFC class hierarchy?

answer What is the class hierarchy tree of CWinApp class?

answer How MFC uses event handling and what is the utility of DECLARE_MESSAGE_MAP(), BEGIN_MESSAGE_MAP() and END_MESSAGE_MAP() macro?

answer Why MFC uses virtual functions for implementing very limited number of events? Why it does not use virtual functions for all event handling?

answer What is UNICODE?

answer How can we give all world wide language support to our application?

answer Mention two major functions to convert ASCII string to UNICODE string and vise versa?

answer What is the job of resource DLL in a project?

answer What is PEN object in GDI?

answer What are some basic styles of a PEN object?

answer What is the utility of NULL PEN?

answer What is BRUSH?

answer What are different types of Brushes?

answer What is the utility of NULL BRUSH?

answer What is the difference between Screen DC and Printer DC?

answer How SaveDC and RestoreDC works?

answer What is RECT?

answer What is Bitmap? And how can I draw a Bitmap?

answer What is pallet?

answer What is font?

answer What are the types of fonts are there?

answer What is MetaFile? How can I store and Retrieve drawing of a window?

answer How can you use GetDeviceCaps(), GetSystemMetrics(), GetFontMetrics() functions to get system settings?

answer What is carat? How we use it?

answer How we use keyboard shortcuts in dialog and menu items?

answer How can I load menu?

answer How can load menu dynamically?

answer How can I use one event function for a range of menu id?

answer How can I use popup menu or a context menu?

answer What is system menu and How can I append extra menu in system menu?

answer What is 'Modal' and 'Modeless' Dialog? Give example and state their uses.

answer How can I create modeless dialog?

answer How can I create a dialog in the middle of Desktop?

answer What are the different member of CDataExchange class?

answer How data and the text in the dialog screen are exchanged in DoDataExchange() routine?

answer What are the result of UpdateData(TRUE) and UpdateData(FALSE) call?

answer 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 How data are validated in data exchange routine?

answer How can I change the text of the message box that comes for the data validation?

answer What is property sheet and property page?

answer How property sheet and page classes works internally?

answer How can I color background of Edit and Static and other controls?

answer How to set a periodic timer event using SetTimer?

answer How can I read or modify windows clipboard?

answer Why Tree and List control are called view control?

answer What is a Image List?

answer What are the types of views supported in ListView?

answer What are the different types of common dialogs?

answer How can I customize a File Open Dialog?

answer Is FindReplace dialog is modal or modeless? Why?

answer What are different types of open mode in CFile?

answer What is the advantage of using CStudioFile class over CFile?

answer How can I open a file on drag-n-drop operation?

answer How can I write a class that supports serializtion?

answer What is the utility of serialization?

answer Does serialization is only used for storing or retrieving information to and from disk filesystem?

answer What is CArchive class in serialization routine? Why a CFile is not used here?

answer What is worker thread and UI thread?

answer How can I create a worker thread using AfxBeginThread() function?

answer How can I create an UI thread using MFC?

answer What are the different synchonization classes provided by MFC?

answer How can I modify attribute of Frame window before creation?

answer What is the Doc/View architecture in MFC? Explain.

answer What is CRuntime class? Where it is used?

answer What is a MFC class that supports dynamic creation?

answer How a MFC class can support RTTI?

answer What is the utility of IMPLEMENT_DYNAMIC?

answer Why in Doc/view classes are created dynamically?

answer How can I construct a Single Document Templete class?

answer Describe workflow of a typical MFC Application that supports Doc/View?

answer How messages are routed in an Doc/View application?

answer What is the utility of OnDraw() function in CView class in Doc/View?

answer How command line arguments are processed in Doc/View?

answer What is the difference between SDI and MDI Application?

answer How can I split a CFrameWnd?

answer What are the sequence of a OnFilePrint() event?

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().