Monday, 15 February 2010

c++ - Overriding Copy Constructor for CObList MFC -


I am working in MFC, and I have my own templated class (CDFAbillist) that comes from the coblig and the member I can accept that my own class (CDFAbject) is obtained from CObject. I have to override the compiler-generated copy constructor for CDFAObList because it eventually works under CObject, in which the personal copy and assignment form The Nkshn and gives me this:

  1> C2248 error: 'CObject :: CObject': can not use declared private member in class' CObject '1;' Cobbet :: Cobbet '1 & gt; View the manifesto of 'Cobbett' see the manifesto of 1 & gt; This function created by the Diagnostic Compiler, 'COBList :: CObList (cost cobbler & amp;)'   

This gives me errors above, although I have the copy maker override and the assignment operator is given the CDFB Overloaded in But when I try to override the copy maker for CDFAObList, I get the following compiler errors:

  1> Error C4430: Missing type specifier - int assumed. Note: C ++ does not support default-int1 gt; See the templates immediate reference to 'cdfabilist & lt; T & gt; Being compiled   

This is my templated class:

  #include "DFAObject.h" #include "DFAManDoc.h" #Include "DFAManTreeView .h "template and lieutenant; Square T & gt; Class CDFobilist: Public Counselist {Public: CDFBist (Zero) {} CDFBylist (CDCountor * PDC, CTreeCtrl * pTree, xml_document * pXmlDoc) {Doctor = PDK; Tree = PTRE; XmlDoc = pXmlDoc; } // Problem Copy Constructor CDFAObList (const CDFAblicist & lt; T & gt; and tocopy) {doc = toCopy.doc; Tree = tocopy.tree; XmlDoc = toCopy.xmlDoc; (Int i = 0; I & lt; toCopy- & gt; GetSize (); i ++) {This- & gt; AddHead ((* T *) to copy-> GetTail ()); }} Preserved: CDCone * Doctor; CTREECtrl * tree; Xml_document * xmlDoc; };   

I have never used a class template before, so I'm probably doing a bunch of wrong things. Thanks in advance for your help.

  CDFAObList ( 
  Instead of CDFAObList (const CDFAblicist & lt; T & gt; toopy)     

>

No comments:

Post a Comment