PDA

View Full Version : Custom Actions


HippyCraig
10-06-2009, 12:14 PM
I created a custom action that calls a .net DLL. I want to pass in a name of a Macro and what type it is. I created two properties one for the MacroName and the other for the MacroType.

The MacroType Property is a Radio Button with a List Data = "Temporary; Project; Global". I can pass in the value to my action only if its not the first option. If Project or Global is selected a value of 1 or 2 is passed in. If Temporary is selected a null value is passed in.

I checked the build script if I select the first value "Temporary" then nothing is stored in the script file. This occurs even if I make the defualt value for that property a value of 2. It still doenst conatin any data in the DLL or the script file.

I would have expected a value of 0 (zero) to be passed in. Am I doing something wrong?

kinook
10-06-2009, 12:33 PM
The default value refers to what the field will default to when a new step of that action type is displayed in the GUI (and stored in the .bld file if the default is used).
http://www.kinook.com/VisBuildPro/Manual/actpropguitab.htm

For radio and combo property types, a value of 0 (the first item in the list/radio) is not stored in the .bld file and it will default to 0 when retrieved.

HippyCraig
10-06-2009, 01:22 PM
If the default is 0 then when my DLL is called a value of null is passed in. If in the property window of the custom action I set the default to another value other then 0 then if the first value is selected then the approprate value is passed in.

Also the value is now stored in the script file itself.

kinook
10-06-2009, 01:30 PM
Are you using Step.ExpProperty to retrieve the value in the custom action (see the NETAction or VBNETAction sample)?
http://www.kinook.com/VisBuildPro/Manual/userdefaction.htm

Please send a reproducible test case.
http://www.kinook.com/Forum/showthread.php?threadid=3044

Thanks.

HippyCraig
10-06-2009, 01:57 PM
See attached file.

kinook
10-06-2009, 03:46 PM
Add

, VariantType.Integer

to the ExpProperty call.

http://www.kinook.com/VisBuildPro/Manual/expproperty.htm

HippyCraig
10-07-2009, 07:47 AM
That did the trick!!! Thanks for the quick response!!