how to load rebuilt external without reopening max?
Aug 09 2010 | 9:10 pm
just starting with external dev.
I have created a max external which loads fine. However, when I rebuild it with a slight change, it just keeps loading the older version of the external that I built previously. It's only when I quit and restart max that it finds the new one.
This happens when destroying the object and creating a new one / retyping the object name etc. after rebuilding.
Is this normal? Is there a way around it?
- Aug 09 2010 | 9:20 pmI'm no expert at this but I think you can set the Runtime version of Max as the executable (extra bonus, you can now debug as well).There is some info in this post:I seem to remember an article a while ago on how to set it up step, by step. I'm sure if you do a search it will show up.Good luck.
- Aug 10 2010 | 8:56 amOK, thanks. I'll try it and report back.
- Aug 10 2010 | 9:14 amThere is no way with a C-based external to reload without rebooting Max.The scenario is different for java externals, which can be altered without the need to reboot, but you may prefer to develop in C for a variety of reasons.Alex
- Aug 10 2010 | 11:10 amI can't believe it! It must be pretty inconvenient to develop externals in C. Is there no way to implement this - even in the future?
- Jul 18 2015 | 11:13 amAnybody know if there's been any change to this behaviour in max7. It really is a royal PITA
- Jul 18 2015 | 11:37 am??? u guys are missing one thing . external file is loaded into a ram while your max application/patcher is launched. DLL external is locked there until u unload it/close the application that uses it . While u are developing your code how would it be possible for VS or XCODE to unload the dll under compilation stage that is used by another program ? CrashJS for example is interpreted at runtime JS engine , this is totally something else .
- Jul 18 2015 | 12:19 pmeg. this suggests it's possible: http://gamedev.stackexchange.com/questions/221/how-can-one-implement-hot-swappable-c-modulesI accept it might mean big changes to the way Max works - and that it might create undesireable complexity etc. Also, this is a benefit to a marginal community relative to the whole userbase of MAX, especially given gen~ - so I'm not moaning if this hasn't been changed. The guys at Cycling74 know their code better than I do. I'm just wondering if there's been a change in this behaviour in MAX7
- Jul 18 2015 | 12:27 pm#EDIT (answer to your previously edited post) are loaded at launch when they are used in your patch , And goes off only when whole Max application is closed (not only the patch that uses your dll). But that doesnt change the fact that is not possible to talk to max from VS or XCODE , they are not integrated in any way . If Cycling would build its own IDE with virtual machine then with some effort would be possible to make such feature working . Indeed that would be ideal for us .
- Jul 18 2015 | 2:05 pmI agree with the above speaker. If Max had its own full blown IDE I would be thrilled. Sadly as it is for now, the nature of Max is still somewhat DYI/hobby. Connecting objects with cables is nice, but there is only so much you can do with it. Sometimes you just need to fall back to program code be it C or Java, especially when the programs are getting more and more complex. If other IDE's had the midi and timing capabilities that Max has, I would already switched a long time ago.
- Jul 18 2015 | 4:46 pmIt's most definitely possible to do dynamic dll unload/reload at runtime with plugin based applications in Windows. I use another piece of software designed for machine vision applications, which is a flowchart-based graphical development environment, and supports C/C++ dll plugins. It watches for any changes to the dll files in use, and if it detects a change prompts the user to reload the plugins.Whether it's possible + how easy it is to do in Max though is another question. Also, given that we're no longer forced to debug in Max runtime (which made things like editing inspector values and debugging attribute accessors near impossible), I'd say it's not at the top of my priority list for the development team.
- Aug 16 2015 | 11:40 amin Xcode->Product->Schemes->Edit Schemeyou can set an Executable for Run and choose Max7. Thereby whenever you rebuild the external, Max will relaunch. If you have problems that the old one is loaded, search and delete old .mxo objects and make sure there is just one filepath to the newly built external. As recently pointed out to me by Jeremy Bernstein, you can build for deployment or build for Development. The latter scenario better for enabling debug points. These are then linked to the process, i..e the executable Max7, so you can better investigate what's actually happening. MIB said the same above but maybe worth repeating anyhow. The flag NDEBUG can be added in Preprocessor Macros if you want to disable exception handling (try, catch exceptions and the like). So it is possible to develop with exception handling in the code, but if NDEBUG is added, this code is not compiled for your deployment(release) version. That's about as much as I know at present.
- Aug 16 2015 | 5:19 pmMax's class loader doesn't support dynamic unloading and reloading of externals. This is unlikely to change, so I recommend using the method @Venetian mentions -- set Max as your external's Executable and you can kill/restart the Max process when you want to test. Now that Max restores your workspace on restart, it's not terribly uncomfortable.