Why can't I assign a .net class instance to a variable?

I am trying to use a .net dll to access another program remotely from within Matlab. I load the dll by calling NET.addAssembly('full path'). I am then able to access the main class from the dll by typing namespace.Classname(arguments). This command is successful b/c a new window opens running the remote application. I then want to be able to access the properties and methods of the class but can't b/c I don't have access to the class instance. To over come this I try running classInstance = namespace.Classname(arguments) but I get the following error:
Message: Unable to cast transparent proxy to type 'Spiricon.BeamGage.Automation.IAutomationCLT'.
Source: Spiricon.BeamGage.Automation
HelpLink:
Any suggestions on how I can assign the instance of this class in Matlab (I am running R2011b)? Thanks.

1 件のコメント

Kirby Fears
Kirby Fears 2017 年 1 月 31 日
Did you look through the documentation?
https://www.mathworks.com/help/matlab/using-net-libraries-in-matlab.html
https://www.mathworks.com/help/matlab/ref/net.createarray.html

サインインしてコメントする。

回答 (0 件)

カテゴリ

製品

タグ

質問済み:

2017 年 1 月 31 日

コメント済み:

2017 年 1 月 31 日

Community Treasure Hunt

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

Start Hunting!

Translated by