which class is the root base class in MFC library

  1. CCmdTarget

  2. CObject

  3. CDocument

  4. CView


Correct Option: B

AI Explanation

To answer this question, we need to understand the MFC (Microsoft Foundation Class) library and its class hierarchy.

The MFC library is a framework developed by Microsoft for building Windows-based applications. It provides a set of classes and functions that simplify the development of graphical user interfaces (GUIs) and other common tasks in Windows programming.

The root base class in the MFC library is CObject, which is option B. CObject serves as the base class for most of the classes in the MFC library. It provides basic functionality such as runtime type information and object serialization.

Let's go through each option to understand why it is correct or incorrect:

Option A) CCmdTarget - This option is incorrect because CCmdTarget is a derived class from CObject and not the root base class.

Option B) CObject - This option is correct because CObject is the root base class in the MFC library. It provides basic functionality that is inherited by other classes.

Option C) CDocument - This option is incorrect because CDocument is a derived class from CCmdTarget and not the root base class.

Option D) CView - This option is incorrect because CView is a derived class from CCmdTarget and not the root base class.

Therefore, the correct answer is option B, CObject, as it is the root base class in the MFC library.

Find more quizzes: