crelf Posted December 30, 2009 Report Share Posted December 30, 2009 Okay - so here's a question: let's say I have a parent class with a bunch of child classes and I build it all into an exe - then, later, I want to add a new child class that inherits from the parent in the exe - is there a way I can just call it by name from disk and have all the inheritance exist? If so, how do I define that in that child class so the parent knows about it? I've got to admit that I haven't actually tried anything - I'm just mulling around an idea at the moment... Quote Link to comment
Grampa_of_Oliva_n_Eden Posted December 30, 2009 Report Share Posted December 30, 2009 In the thread that Tomi M started to demo the dynamic event feature he included a demo that let you drop square circles etc. Latter in that thread I followed-up and he posted a modified demo that showed how to do it in an exe. In a nut shell... You search for all LV classes that can be cast as the parent type without errors. The parents don't have to know about the children at compile time. Ben Quote Link to comment
Norm Kirchner Posted December 30, 2009 Report Share Posted December 30, 2009 I've done it, it's cool and it's not too hard. You simply need to put some callable command in the exe which will look at a path for your new .lvclass and within that command, run the 'Get Default Class Data'. If that completes successfully, then your new class is loaded into memory and ready to rock and roll. Within LVSpeak I do this by scanning my Plugin directory for all .lvclass files, running the 'get default data' and then just as a sanity check, run a common method on all of those loaded default values. The same tactic would apply to an exe <a href="http://content.screencast.com/users/NJKirchner/folders/Jing/media/28e55bc6-47fd-42ff-a581-66ca58b37cb7/2009-12-30_1202.png"><img'>http://content.screencast.com/users/NJKirchner/folders/Jing/media/28e55bc6-47fd-42ff-a581-66ca58b37cb7/2009-12-30_1202.png"><img class="embeddedObject" src="http://content.screencast.com/users/NJKirchner/folders/Jing/media/28e55bc6-47fd-42ff-a581-66ca58b37cb7/2009-12-30_1202.png" width="364" height="190" border="0" /></a> Quote Link to comment
crelf Posted December 30, 2009 Author Report Share Posted December 30, 2009 Thank you gents - I should have known that it was relatively easy Huge kudos to the NI R&D team that gave us LVOOP - IMHO it was really well thought-out Quote Link to comment
Aristos Queue Posted December 31, 2009 Report Share Posted December 31, 2009 The parents don't have to know about the children at compile time. In fact, parent classes never know about their descendants. No data about any child classes is ever saved in a parent class, development or runtime environment. Quote Link to comment
crelf Posted December 31, 2009 Author Report Share Posted December 31, 2009 No data about any child classes is ever saved in a parent class, development or runtime environment. ...and nor should it - but it's good to get the confirmation - thanks Stephen! Quote Link to comment
jon_mcbee Posted January 4, 2010 Report Share Posted January 4, 2010 In the thread that Tomi M started to demo the dynamic event feature he included a demo that let you drop square circles etc. Latter in that thread I followed-up and he posted a modified demo that showed how to do it in an exe. In a nut shell... You search for all LV classes that can be cast as the parent type without errors. The parents don't have to know about the children at compile time. Ben Hi Ben, Can you provide a link to the Tomi M thread? I looked for it but couldnt find it. Regards Quote Link to comment
crelf Posted January 4, 2010 Author Report Share Posted January 4, 2010 Follow-up: I did some testing over the weekend and this works great! I now have a sleak application that can remain a closed product, and then when each project needs to use it they can "install" LVOOP plugins (I have several built up) and create their own that are project specific. This makes me happy. Quote Link to comment
Grampa_of_Oliva_n_Eden Posted January 4, 2010 Report Share Posted January 4, 2010 Follow-up: I did some testing over the weekend and this works great! I now have a sleak application that can remain a closed product, and then when each project needs to use it they can "install" LVOOP plugins (I have several built up) and create their own that are project specific. This makes me happy. Congrats! You do realize that you are now responcilbe for any bug that sneaks in thru that door. kidding aside... i got a nice warm feeling the first time I saw my exe start and find the new functionality dynamically. Ben Quote Link to comment
crelf Posted January 4, 2010 Author Report Share Posted January 4, 2010 You do realize that you are now responcilbe for any bug that sneaks in thru that door. Hey man - my app's only repsonsibility is to report issues it sees i got a nice warm feeling the first time I saw my exe start and find the new functionality dynamically. Mine too - although that was a looong time ago. I've done heaps of dynamic plug-in sutff before, just never LVOOP. The posibilities are endless... Quote Link to comment
Daklu Posted January 4, 2010 Report Share Posted January 4, 2010 Chris, I'm a little confused about your original question. I thought you were asking about creating a new class in the dev environment that inherits from a parent that has been compiled into an arbitrary .exe, something you might want to do if you didn't have the original source code. Did I misunderstand? The responses appear to require source code access, either to inherit from the parent directly, or to implement an abstract plug-in layer that external code can inherit from. Quote Link to comment
Norm Kirchner Posted January 4, 2010 Report Share Posted January 4, 2010 Follow-up: I did some testing over the weekend and this works great! I now have a sleak application that can remain a closed product, and then when each project needs to use it they can "install" LVOOP plugins (I have several built up) and create their own that are project specific. This makes me happy. sexy sexy sexy Quote Link to comment
Tomi Maila Posted January 12, 2010 Report Share Posted January 12, 2010 I wrote an article on the subject a few years back on ExpressionFlow expressionflow.com/2008/06/02/extending-labview-built-applications-with-lvoop-plugins/ Tomi 1 Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.