Hi…
I got a problem with ApplicationCommandTarget and ApplicationCommandManager…
Here is the situation:
There’s one of the main components of my app (called A) that inherits from ApplicationCommandTarget and all gone well (its commands work fine); in this component, there’s a command that create another component (called B) that inherits from ApplicationCommandTarget too; after creating this child, it (A) use “registerAllCommandsForTarget” to register its commands.
Compiling it’s ok but when I run the application and use the command to create the child (B) the app crashes…
All the virtual methods are implemented in the same way… so I don’t know why A works and B not!!!
(if i leave B::getAllCommands (…) empty it runs but, of course, its commands don’t work).
Maybe I’m missing something stupid but I don’t know.
Yes Jules… I’ve already debugged the code and it crash when trying to add new commandId to the commands array ( getAllCommands(…) ) …
I don’t know but i’m continuing with the debug… if you have any issue you are kind and welcome!
thanks
You might want to post the code that creates the B object. When I run into this, I’ve generally done some bonehead and my object is being deleted at the end of it’s scope.
To see, put a breakpoint in the B object’s destructor. See if it gets called before A gets the commandIDs (or before you use it).