CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: MFC DYNCREATE

  1. #1
    Join Date
    May 2000
    Location
    Ireland
    Posts
    503

    MFC DYNCREATE

    Hi i know how to create a CObject derived class as follows.
    But the CObject class has an operator new.
    How can i use this instead?

    b
    //everything rated


    CRuntimeClass* pRuntimeClass = RUNTIME_CLASS(CNote1);
    CObject* pObject = pRuntimeClass->CreateObject();
    CNote1* pNewView = dynamic_cast<CNote1*>(pObject);





    Of course I do it for the ratings!

  2. #2
    Join Date
    Apr 2000
    Location
    Switzerland
    Posts
    944

    Re: MFC DYNCREATE

    Why not just

    CNote1* pNewView = new CNotel;






  3. #3
    Join Date
    May 2000
    Location
    Ireland
    Posts
    503

    Re: MFC DYNCREATE

    thanks for trying, but this won't work because my constructor is declared protected.
    I need the CObject::new operator somehow i thing.

    b

    Of course I do it for the ratings!

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured