05-23-2025 04:57 PM
Hello,
I'm trying to find a way to programmatically wrap some ActiveX event registration... using VI scripting.
I'm stuck with a generic GrowableFunction (Generic » GObject » Node » GrowableFunction » GrowableFunction). When just getting AllObjs[] from Diagram, this is the type of reference I get for an already existing Register Evetn Callback node on the diagram. I didn't find a way to use this (I guess) too generic level to select a event to register.
snippet.png
The REG_EVT_CLLBCK.vi diagram looks like this:snippet_REG_EVT_CLLBCK.png
I've seen that under GrowableFunction, you can find ObjectFunction and then Contructor, Property, Invoke.
Using theses Property and Invoke class, I'm able to select a property or a method of a already existing node using sripting (you need to allow alternate names).
snippet_PropertyNode.png
But I do not manage to get an enought specific class in VI server for the Register Event Callback node.
Is there a trick to select the event to register using VI scripting ?
Or did I reach a kind of dead end ?
Thanks in advance for your help.
05-23-2025 09:38 PM
"GrowableFunction" objects have a "Style" property. In this case, the style is "Register Event Callback".
My guess is that other particulars are stored in tags of the object; but I couldn't find them.
05-24-2025 11:12 AM
My other guess is that it's an unexposed property.
An example of that is the bezel color on classic controls.
paul_a_cardinale_0-1748102871827.png
You can change the color with the "Set Color" tool, but it's not accessible programmatically; not even with this:
paul_a_cardinale_1-1748103053308.png (I know, I tried all 4,294,967,295 index values.)
05-28-2025 04:16 AM
Thanks for your answers. I'll "brute force" properties by index... With some luck, I'll find something interesting to get this programmatic event selection done.
05-28-2025 03:04 PM
@Mathieu_R. wrote:
Thanks for your answers. I'll "brute force" properties by index... With some luck, I'll find something interesting to get this programmatic event selection done.
Here is what I have on that.
06-20-2025 10:56 AM - edited 06-20-2025 10:57 AM
Wow, this is... awsome !! Thank you very much for sharing this.
My 'brute force' investigation did not allow me to identify any other property using this Get/Set Property methods.
And I didn't manage to configure the event to register.
06-22-2025 09:38 AM
Hi Mathieu,
I couldn't find a way to set the event either.
Maybe you could post an idea in the Idea Exchange?
I guess this would require to add a new subclass of "GrowableFunction" that would be named "RegisterEventCallback", very similar to class "RegisterForEvents".
Its properties could be:
- "Event Types": IDs of selected events.
- "Supported Event Types": names and IDs of all selectable event types for the wired class.
- "Name Format": no names / short names / long names.
Regards,
Raphaël.