09-11-2013 09:28 AM
Hello there,
I have a plugin architecture and I want to load a particular class on demand, when a user clicks a button etc.
I can do this using 'Get LV Class Default Value.vi' knowing the path of the .lvclass file, and I can then use the 'To More Specific Class' vi to cast it from type LV Object to the specific class I know it to be.
However if I have 30 different classes with this method I would have to have 30 different class constants in a case structure so I can cast to the right one. This works but it means all the classes are loaded into memory when the program is run, even though the user may never want to use most of them, which is a waste of time/memory.
Is there a better way of doing this please?
Thanks,
Martin
09-11-2013 09:55 AM - edited 09-11-2013 09:58 AM
I wonder if minute 4:00 in Michael's video will help you. It avoids the constants, as long as all the classes are descendants of a common class:
09-11-2013 10:26 AM
Thank you for the helpful link, it is working fine now. I had made a silly mistake.