Cycling74 / min-devkit

Tools, documentation, and reference implementation of a Max Package built using the Min-API.
MIT License
158 stars 31 forks source link

Impossible to register object at construction #128

Closed pixsperdavid closed 5 years ago

pixsperdavid commented 5 years ago

I have a nobox object which is the central service for a bunch of client objects which are instantiated in the patcher. The nobox object (which lives in the extensions folder and is loaded at Max startup) needs to register itself to a known symbol so the client objects can find it and message it.

I can't find a way to actually perform the registration. The 'object_register' function requires the t_object* pointer which is inaccessible in both the constructor and the 'maxclass_setup' message handler. Being a nobox object, there's no way for me to call a method once initialized.

I can't think of any solution to this that doesn't require having a reference to the t_object* pointer at construction. I've tried timer/queue to call the registration function later, but they cannot be set from the constructor or 'maxclass_setup'.

pixsperdavid commented 5 years ago

Upon further investigation I discovered that the issue was actually due to the object never being instantiated, despite it being a nobox object and present in the 'extensions' directory. Closing and creating a separate issue for this.