CreateDynProperty for Function in VSTA

CreateDynProperty for Function in VSTA

Hallo! I have 3 variables - INT.A, Replaced.A, Replaced2.A in my project. Also I have one popup screen POPUP, with field that shows INT.A value. Also I have 2 functions - INT that shows POPUP without any substitutions. REPLACED that shows POPUP with substitution INT=>Replaced I want to show POPUP with substitution INT=>Replaced2 by VSTA. When I use function with already initiated substitutions (REPALCED) and just replace destinations all works fine (see example below).
C# Code:
public void Macro_ShowReplaced() { zenOn.IRtFunction exportFunction = this.RtFunctions().Item("REPLACED"); exportFunction.set_DynProperties("PictSwitch[0].SubstiVar[0].Destination", "Replaced2.A"); exportFunction.Start(); }
When I use function with non-initiated substitutions (INT) and try to create and init them in code it doesn't work (funciton acts as there is no substitution at all) - look at example below. BTW, when i try to access just created dynProperty exception occurs.
C# Code:
public void Macro_ShowCreated() { zenOn.IRtFunction exportFunction = this.RtFunctions().Item("INT"); exportFunction.CreateDynProperty("PictSwitch[0].SubstiVar[0].Source"); exportFunction.set_DynProperties("PictSwitch[0].SubstiVar[0].Source", "INT.A"); exportFunction.CreateDynProperty("PictSwitch[0].SubstiVar[0].Destination"); exportFunction.set_DynProperties("PictSwitch[0].SubstiVar[0].Destination", "Replaced2.A"); exportFunction.Start(); }
What do I wrong? I use 6.51 build 7.

This is a migrated post! Originally posted on 17.05.2012 by user stolyarov_as. Please be aware that information can be outdated.