1 Reply Latest reply: Feb 21, 2013 4:05 PM by Rallymax-forum RSS

    Creating C++ objects inside an exporter plugin (CS6 SDK)

    nvenc4everyone Community Member

      I have downloaded the Adobe CS6 SDK.  In the exporter example, inside exSelBeginInstance(), there are calls to "memory suite" API.  This grabs some memory (at runtime) for a C-struct/array.

       

      In my case, I need to call the new() operator on a derived C++ class.  The idea is that I'll create the object during exSelBeginInstance(), then delete it during exSelEndInstance.


      If I use the new() operator, then the memory-suite won't know about the object at all. Alternatively, I could call the memory-API to grab a chunk of memory the size of "sizeof(my_class)"  But this doesn't work correctly either, because the object itself may need to create instances of other classes.

       

      So is there a way to safely use dynamically created C++ objects inside an exporter plugin? Or do I have re-architect everything to avoid calling the new() constructor?