Borrar filtros
Borrar filtros

Event handler for COM ActiveX object (actxserver)

2 visualizaciones (últimos 30 días)
Peter
Peter el 17 de Jun. de 2014
Comentada: Peter el 17 de Jun. de 2014
I am trying to write "event handler" to COM ActiveX object
>> h = actxserver ('ProgID'); >> h.registerevent({'DataReady' 'h_plot'});
%event handler function h_plot( varargin ) data = h.GetData; plot(data(1,:)) end
So I am getting an error as follows
Error using comeventcallback (line 34) Error firing event 'DataReady' to 'h_plot'.
Warning: Error occurred while evaluating listener callback.
How can I use a method of the COM Object within handler function? If I use (data = h.GetData;) out of event handler then it works...
Thanks. Peter
  1 comentario
Peter
Peter el 17 de Jun. de 2014
command window
>> h = actxserver ('ProgID');
>> h.registerevent({'DataReady' 'h_plot'});
%m-script
%event handler
function h_plot( varargin )
data = h.GetData;
plot(data(1,:))
end

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Use COM Objects in MATLAB en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by