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

    Help in Visual C ++2005 programming

    Scheduled Pinned Locked Moved SDK Help
    4 Posts 0 Posters 407 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 09/09/2008 at 03:45, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   10.5 
      Platform:   Windows  ;   
      Language(s) :   C.O.F.F.E.E  ;  C++  ;

      ---------
      Hi there ..

      i tried to create a cube object ...

      in coffee the code was :
      var cube1 = new(CubeObject);
      cube1->SetName("Object");
      GetActiveDocument()->InsertObject(cube1,NULL,NULL);

      but in VC++ error show up ..

      i take a look in the SDK i found this :

      static BaseObject* Alloc(ocube)

      VC++ gives errors on "ocube" and i'm sure it's right

      and this :

      BaseObject *GeneratePrimitive(BaseDocument *doc, LONG type, const BaseContainer &bc;, Real lod, Bool isoparm, BaseThread *bt)

      but i didn't know the exact parameters ..

      So help me please ..

      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 09/09/2008 at 03:55, xxxxxxxx wrote:

        I see two errors here.

        First in COFFEE you should use

        AllocObject(Ocube) and not new(CubeObject) anymore.

        Second it is Ocube and not ocube.

        In C++ it would be something like this

        > \> BaseObject \*cube = NULL; \> cube = BaseObject::Alloc(Ocube); \> if(!cube) return FALSE; \> \> doc- >InsertObject(cube, NULL, NULL); \>

        Please also check the SDK examples.

        cheers,
        Matthias

        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 09/09/2008 at 06:23, xxxxxxxx wrote:

          i tried your code and give me 2 errors :

          Error 1 error C2065: 'doc' : undeclared identifier

          Error 2 error C2227: left of '->InsertObject' must point to class/struct/union/generic type

          it works when i Define the doc :

          BaseDocument *doc = GetActiveDocument();
          BaseObject *cube = NULL;
          cube = BaseObject::Alloc(Ocube);
          doc->InsertObject(cube, NULL, NULL);

          thanks Matthias ...

          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 09/09/2008 at 06:28, xxxxxxxx wrote:

            doc is the BaseDocument.

            Please check the SDK examples and the SDK documentation for a general introduction into the C++ plugin API.

            cheers,
            Matthias

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