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
    • Recent
    • Tags
    • Users
    • Login

    GeAutoDynamicArray question

    Scheduled Pinned Locked Moved SDK Help
    3 Posts 0 Posters 228 Views
    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 Offline
      Helper
      last edited by

      THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

      On 13/03/2011 at 14:01, xxxxxxxx wrote:

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

      ---------
      Is it possible to create an array of my own class using GeAutoDynamicArray<MyClass> myArray;

      ?

      When I try it I get an error stating that there is no acceptable contructor for TYPE = MyClass

      Here's the error:

        
        
      \>c:\program files\maxon\cinema 4d r12 demo\resource\_api\ge_dynamicarray.h(708) : error C2512: 'MyClass' : no appropriate default constructor available  
      1>        c:\program files\maxon\cinema 4d r12 demo\resource\_api\ge_dynamicarray.h(665) : while compiling class template member function 'Bool GeDynamicArray<TYPE>::ReScope(VLONG)'  
      1>        with  
      1>        [  
      1>            TYPE=MyClass  
      1>        ]  
      1>        c:\program files\maxon\cinema 4d r12 demo\resource\_api\ge_dynamicarray.h(1238) : see reference to class template instantiation 'GeDynamicArray<TYPE>' being compiled  
      1>        with  
      1>        [  
      1>            TYPE=MyClass  
      1>        ]  
        
      

      Thanks,

      Shawn

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

        THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

        On 13/03/2011 at 16:25, xxxxxxxx wrote:

        You must declare as a pointer like this:

        GeDynamicArray<LibraryItem*>        items;

        Then you need to ALLOCATE a new instance and push it into the array.  Doesn't work any other way as my experience goes.

        LibraryItem*    li =    gNew LibraryItem;
          if (!li)                return ErrPrt("Greebler.Library.LoadItem.li failed!");
          items.Push(li);

        Use .Free() to clear and .Count() to get the number of array elements.

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

          THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

          On 13/03/2011 at 16:53, xxxxxxxx wrote:

          Thanks Robert..  Not sure why didn't think of making it a pointer  HAHAHA...    I appreciate your help.

          ~Shawn

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