Load object from disk and object_new_typed
Hi,
I have a family of externals that use a common proxy object to communicate with one another. This works fine, but it is necessary for me to manually load the proxy object from disk before I use the other objects. To create an instance of the proxy object I call object_new_typed() from within the new routine. If I haven't previously loaded the object from disk this returns zero.....
Is there a way to programmatically load from disk the first time ANY of these objects is instantiated? That would be really neat - obviously I can place my proxy object in the init folder, but that's a little bit of a pain...
A.
Hi Alex,
In Jamoma there is a function called jcom_core_loadextern() that does this. The source for that function is located in this file: https://github.com/jamoma/JamomaModular/blob/master/library/source/jcom.core.cpp
HTH,
Tim
Thanks for that. The core of it seems to be that newinstance (unlike object_new_typed) will load the external from disk if necessary - right? Will this still work with an obex / no box object ? It looks like maybe the newinstance will work to load the class, but then object_typed_new is neccesary to create the instance you want to you - have I got this right?
Thanks again,
Alex