ActiveX controls and Event Listening in a GUIDE?

3 views (last 30 days)
I have been attempting to listen to an event that is fired by an ActiveX control, and I believe I have satisfied everything outlined in the examples of this tutorial: http://www.mathworks.com/help/matlab/ref/actxcontrol.html. The first function shown below registers the event with the event handler. The second function shown below is the event handling callback function.
function dObj = Dataray(curr_fig)
dObj.getDataCtrl = actxcontrol('DATARAYOCX.GetDataCtrl.1' [0,0,1,1],dObj.currentFigure);
events(dObj.getDataCtrl)
handlerMessage = @dObj.eventCallback;
dObj.getDataCtrl.registerevent({'SendMessage',handlerMessage});
eventlisteners(dObj.getDataCtrl)
end
function eventCallback(dObj,varargin)
dObj.eventcounter = dObj.eventcounter +1; % no ; for debugging
display(sprintf('%d frames seen', dObj.eventcounter));
end
I utilize events() and eventlisteners() on the ActiveX control to list the events and their handler routines.
events() prints this to the command window:
SendMessage = void SendMessage(int32 Message, int32 LongValue, double DoubleValue)
DataReady = void DataReady()
eventlisteners() prints this to the command window:
'SendMessage' @(varargin)dObj.eventCallback(varargin{:})
I know that the "SendMessage" event is firing in the OCX, and it appears as if MATLAB recognizes what is going on according to the output of events() and eventlisteners(), but when I place a breakpoint in the eventCallback function, it is never hit.
What am I missing? Any advice is appreciated. Thank you!

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!