Plugin crashes at mouse click



  • 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?



  • 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.



  • 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;
    }
    /*...*/



  • 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.



  • 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?



  • 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.



  • 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!



  • 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.


Log in to reply