Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    cannot access private member

    SDK Help
    0
    4
    455
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H
      Helper
      last edited by

      On 31/08/2017 at 02:17, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   R16 
      Platform:   Windows  ;   
      Language(s) :     C++  ;

      ---------
      I have a tag plugin with a sorted basearray and everything was ok, until I implemented CopyTo().
      Now I am getting "error C2248: 'maxon::SortedArray<MYSELF,ARRAY>::operator =' : cannot access private member declared in class 'maxon::SortedArray<MYSELF,ARRAY>' c:\program files\maxon\cinema 4d r16\plugins oggle visibility development\source oggle visibility.cpp 10 1 Toggle Visibility"

      What to do?
      I read other posts about this issue, but I did not see a solution.

      struct MySortedIntegerArray : public maxon::SortedArray<MySortedIntegerArray, maxon::BaseArray<Int> >
      {
      	// your sorted array must implement a LessThan() method
      	static inline maxon::Bool LessThan(Int a, Int b)	{ return a < b; }
      };
        
      class ToggleVisibilityC : public TagData
      {
        
        public:
      	MySortedIntegerArray switchFramesList;		//is automatically sorted.
      	Int32 switchFramesStartOnOff;
        
      	virtual Bool Init(GeListNode* node);
      	virtual EXECUTIONRESULT Execute(BaseTag* tag, BaseDocument* doc, BaseObject* op, BaseThread* bt, Int32 priority, EXECUTIONFLAGS flags);
      	virtual Bool GetDDescription(GeListNode* node, Description* description, DESCFLAGS_DESC& flags);
      	virtual Bool Message(GeListNode* node, Int32 type, void* data);
      	virtual Bool CopyTo(NodeData* dest, GeListNode* snode, GeListNode* dnode, COPYFLAGS flags, AliasTrans* trn);
        
      	....
      };
        
      Bool ToggleVisibilityC::CopyTo(NodeData* dest, GeListNode* snode, GeListNode* dnode, COPYFLAGS flags, AliasTrans* trn)
      {
      	((ToggleVisibilityC* )dest)->switchFramesList = switchFramesList;		// <== Error
      	((ToggleVisibilityC* )dest)->switchFramesStartOnOff = switchFramesStartOnOff;
      	return NodeData::CopyTo(dest, snode, dnode, flags, trn);
      	//return true;
      }
      
      1 Reply Last reply Reply Quote 0
      • H
        Helper
        last edited by

        On 31/08/2017 at 13:26, xxxxxxxx wrote:

        ((ToggleVisibilityC* )dest)->switchFramesList.CopyFrom(switchFramesList);

        1 Reply Last reply Reply Quote 0
        • H
          Helper
          last edited by

          On 31/08/2017 at 23:10, xxxxxxxx wrote:

          That works, thank you very much!

          -Pim

          1 Reply Last reply Reply Quote 0
          • H
            Helper
            last edited by

            On 01/09/2017 at 08:07, xxxxxxxx wrote:

            Hello,

            the documentation includes the description of the BaseArray class (and its member functions like CopyFrom() ).

            best wishes,
            Sebastian

            1 Reply Last reply Reply Quote 0
            • First post
              Last post