findobj 'blind' when used in a COM object's event

Discussion in 'MATLAB' started by Clement Val, Aug 24, 2010.

  1. Clement Val

    Clement Val Guest


    So... I have a function which is called in response with different events in order to refresh the content of a GUI I created with Guide.
    When called from GUI's callbacks, everything works fine, as expected.

    However, this gets messy when the function is called by a COM object's event.

    This is because, in such case, findobj, which is used in this function, fails to find anything.

    What is the reason of this behaviour ?

    Is there a workaround (other than passing handles as arguments : i.e. to really make findobj work) ?

    Whatever the reason of this behaviour, are there other consequences of what causes this findobj blindness ?

    The COM object's developer told me that this might be because the event comes from an internal thread of the COM object. Whatever that means (I'm clueless about this kind of things), he also asks : if it is possible to use MATLAB message queuing instead of/complementary to the event usage. (like PostMessage in windows API) to post an event like a click event from the event registered function ?

    Any help appreciated !

    Clement Val, Aug 24, 2010
    1. Advertisements

  2. Clement Val

    Steven_Lord Guest

    What is the value of the HandleVisibility property for the objects that
    you're trying to find with FINDOBJ?
    Change the HandleVisibility property of your objects or use FINDALL.
    If the HandleVisiblity property is the cause of this behavior, see the
    documentation to which I linked above.

    Steve Lord

    comp.soft-sys.matlab (CSSM) FAQ:
    To contact Technical Support use the Contact Us link on
    Steven_Lord, Aug 24, 2010
    1. Advertisements

  3. Clement Val

    Clement Val Guest

    Hello, thanks for your answer Steve.

    All the objects we try to 'refresh' using findobj have a HandleVisibility with value : 'on' . As I wrote, this really works as we would expect when called by a callback from the GUI.

    The problem is when the same exact function is called by an event from a COM object. In such case, findobj is blind.
    Clement Val, Aug 24, 2010
  4. Clement Val

    Clement Val Guest

    Update : putting handlevisibility "on" on the GUI figure indeed helps ;-)
    Thanks !
    Clement Val, Aug 24, 2010
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.