+ Reply to Thread
Results 1 to 2 of 2

Thread: What is CObject in MFC?

  1. #1
    Junior Member
    Join Date
    Feb 2012
    Posts
    49

    What is CObject in MFC?

    What is CObject? What functionality it provides?

  2. #2
    Senior Member
    Join Date
    Feb 2012
    Posts
    109
    CObject is the root class for classes in the MFC library.

    It provides services like:
    a. Run-time type information for class
    b. Serialization support
    c. Debug/diagnostic information output

    Note:
    CObject class does not support multiple inheritance. that is:

    Code:
    class CMyObject1 : public CObject
    {
    public:
    	CMyObject1() : CObject()
    	{
    	}
    } ;
    
    class CMyObject2 : public CObject
    {
    public:
    	CMyObject2() : CObject()
    	{
    	}
    } ;
    
    class CMyObject3 : public CMyObject1, public CMyObject2
    {
    public:
    	CMyObject3() : CMyObject1(), CMyObject2()
    	{
    	}
    } ; //error C2385: 'CMyObject3::delete' is ambiguous

+ Reply to Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts