Sent MIDI Message with IVToggleControl

I want to send a MIDI message (CC 102, Msg 64) when it is toggle on and a different value (Msg 0) when it is toggled off. How can I do this?