User | Kudos |
---|---|
4 | |
2 | |
1 | |
1 | |
1 |
I'm finding that often my classes have some sort of dynamic private data that needs to be initialized before the object will work correctly. (Queues, User Events, etc.) Currently I have to implement some sort of initialization vi that the class user must call every time an object is created. If the user forgets to do this Labview raises an invalid refnum error. There are workarounds such as wrapping the class in a .lvlib, using class factories, or checking the queue refnum with every class sub vi. However, they are workarounds that require extra coding and add complexity.
I'd like to have the ability to define a private class constructor that fires behind the scenes every time an object constant or control returns the default value during execution. With this ability I can be certain the object's dynamic resources have been allocated correctly and it simplifies the api for class users.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Any idea that has received less than 8 kudos within 8 years after posting will be automatically declined.