Why do I receive an error when trying to invoke a method on an object that has reference or optional arguments?
이전 댓글 표시
Why do I receive an error when trying to invoke a method on an object that has reference or
optional arguments?
Consider a COM object that has a method with following signature:
[id(1), helpstring("method AllinOne")] HRESULT AllinOne([in] double db, [out] BSTR* strout,
[in, out] long* ln, [in,optional] BSTR strin, [out, optional] VARIANT* var,
[out,retval] BOOL* bret);
This is the code I use in MATLAB:
h=actxserver('TestServer.ArgTest.1');
[a,b,c,d] = invoke(h, 'AllinOne', 5.57, 10, 'test')
But MATLAB returns:
??? No method with matching signature.
As you can see, MATLAB incorrectly thinks the signature for the AllinOne method is as follows:
invoke(h)
AllinOne = [int32, string, int32] AllinOne(handle, double, int32, Variant(Optional))
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 ActiveX에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!