How to hide or protect class properties of COM Builder COM objects

Discussion in 'MATLAB' started by Doug, Jan 7, 2008.

  1. Doug

    Doug Guest

    Hi, all. I'm using Matlab COM Builder to build a COM object out of some .m files, and would like to share a single instance of a large matrix among several functions, rather than passing copies of it as an argument to those functions.

    The way to do this as documented by Mathworks is to declare as global, in every function which needs to access it, any variable to be shared. When those functions are compiled into member functions of a COM object, they all have access to the global variable, which becomes a class property of the resulting COM object.

    BUT...I would like for that property to be either hidden, or read-only, to the COM client.

    There's no documented way to do that, as far as I can find. Any suggestions?

    Thanks!
     
    Doug, Jan 7, 2008
    #1
    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.