NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

defining a custom UIMessage

I need to create a couple of custom UIMessages.  I know I need to use UIMsg_UserMessageBase + offset.  What I'm not sure about is where to define these constants.  I've seen in the ActiveX/COM call dialong (in TestStand) where (in the eventCode parameter) I can place UIMessageBase +0, +1, etc.  What I'm wondering, though, is if I wanted to name my messages (i.e. UIMsg_UserMessageBase_CoolEvent), is there a .ini or other file where I could store these values?  Would the custom messages be grouped (available in LabVIEW/TestStand drop-downs) with the other TestStand-defined events (i.e. UIMsg_BreakOnUserRequest)?
0 Kudos
Message 1 of 4
(3,349 Views)

Hey mrbean,

Unfortunately, there's no good way to access the other default UIMessages associated with the TestStand Engine.  The appropriate way to define and subsequently handle your own custom UIMessage is detailed in this Developer Zone tutorial.

 
Derrick S.
Product Manager
NI DIAdem
National Instruments
0 Kudos
Message 2 of 4
(3,319 Views)
I know of no way to do a truely custom UI message like you want to do with names. The only way I have figured out how to do it is with numbers starting at 10,000.
If you find another way please tell me, because doing it with numbers is not very intuitive or readable in code.



Joe.
"NOTHING IS EVER EASY"
0 Kudos
Message 3 of 4
(3,310 Views)
If you want to ensure that no one else is using the same event code as you are you can use: Engine.RegisterUIMessage to create a uimessage event code for a given name. This does not however make the name show up in labview or anywhere, but it does guarantee a more unique event code for your uimessage in a situation in which other developers might be creating custom UI messages too and you want to make sure yours don't conflict with theirs.

-Doug


Message Edited by dug9000 on 03-13-2008 01:57 PM
0 Kudos
Message 4 of 4
(3,299 Views)