Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware 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

    Plugin crashes at mouse click

    SDK Help
    0
    8
    746
    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

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

      On 05/07/2008 at 03:44, xxxxxxxx wrote:

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

      ---------
      Hi,
      I programmed a plugin that works - if you don't do anything. Depending on the settings the plugin works very long, sometimes some minutes. If I do anything while the plugin is working, like clicking on anything, Cinema 4d crashes (as I know from the bugreport because of an access-violation. Why is that so and what can I do against it?

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

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

        On 05/07/2008 at 08:23, xxxxxxxx wrote:

        I'd check for invalid pointers first off. Make sure they are valid whenever they are acquired or memory is allocated.

        After that, check your api lib build and project settings against the cinema4dsdk project settings.

        At this stage, you'll have to eliminate possible culprits.

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

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

          On 05/07/2008 at 09:37, xxxxxxxx wrote:

          Hi!

          For this event you have to use the debugger. Check out where the debugger stops and try to read out the settings / parameters. A reason could be an invalid pointer, etc. The following code is only an example.

          BaseDocument* doc= NULL;

          doc = GetActiveDocument();

          if!doc)
          {
                printf("ERROR");
                return false;
          }
          /*...*/

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

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

            On 06/07/2008 at 02:03, xxxxxxxx wrote:

            Double-check your compiler flags and make sure you have:
            /vmg /vms
            ...on there.

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

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

              On 17/07/2008 at 02:55, xxxxxxxx wrote:

              @Giblet: Where can I edit the compiler flags?

              I don't know what it is. At the end of my GetVirtualObjects I got the following code:
              <CODE>
                        if(!poly)
                        {
                             GePrint("Poly");
                             return false;
                        }
                        if(!doc)
                        {
                             GePrint("doc");
                             return false;
                        }
                        temp=poly;
                        doc->EndUndo();
                        GePrint("Benötigte Zeit: " + RealToString((GeGetTimer()-starttime)/1000) + " Sekunden");
                        return poly;
              </CODE>

              This one crashes if I work with another program, while the object is generated. It seems like poly and doc are ok, because the code in the {} isn't executed. But on the other side the code doesn't crash if I put "return false;" before "(if(!poly))".
              Why is that so?

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

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

                On 18/07/2008 at 01:27, xxxxxxxx wrote:

                doc->EndUndo();

                This one is not necessary (I don´t even know if it´s safe to do so!). You don´t need to generate undos in GetVirtualObject as the document you are modifying is NOT the scene document but a virtual document.

                So that might trigger the crash I could think.

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

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

                  On 18/07/2008 at 06:30, xxxxxxxx wrote:

                  That's it. I deleted everything that has to do with undos after i red in the sdk, that these are not allowed in threading functions as GetVirtualObjects.

                  Thanks a lot everyone!

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

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

                    On 18/07/2008 at 11:12, xxxxxxxx wrote:

                    Quote: Originally posted by Basti8 on 17  July 2008
                    >
                    > * * *
                    >
                    > @Giblet: Where can I edit the compiler flags?
                    >
                    >
                    > * * *

                    It sounds like you found your problem, but the answer to the above will depend on which compiler you're using.  In VC 2008, you'd add those as "Additional Options" to the "Command Line" page of the Compiler options, if they weren't already part of the command line shown there.

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