필터 지우기
필터 지우기

Matlab COM connection using an actxserver

조회 수: 9 (최근 30일)
David Kusnirak
David Kusnirak 2018년 7월 16일
댓글: Guillaume 2019년 6월 1일
Hello,
I'm running a Matlab script to invoke an another software (Surfer) to calculate grids from data. The code was downloaded from fileexchange - ( gridding_surfer ). The code worked perfectly some months ago, however now I'm not able to run the code.
After I run
SurferApp = actxserver('surfer.application');
I'm getting an error code:
Error using feval
Server Creation Failed: Server execution failed
Error in actxserver (line 86)
h=feval(['COM.' convertedProgID], 'server', machinename, interface);
Apparently the progID is not working, I checked the Windows registry, but everything seems to be fine there and a progID is associated the application. Is there a way how to debug it more in detail, e.g. list or edit or progID?
  댓글 수: 2
Jason Xu
Jason Xu 2019년 6월 1일
Hi David, I was wondering if you can open two Surfer softwares by using actxserver? Thanks
Guillaume
Guillaume 2019년 6월 1일
@Jason,
Most likely no. That's not because of actxserver but because the Microsoft COM technology it relies on doesn't allow you to do that.
The only ways this could be possible would be if either:
  • You were trying to launch two different version of the software AND the softwate use a versioned progID
  • The software COM interface has been specifically designed to start several instances.

댓글을 달려면 로그인하십시오.

채택된 답변

Guillaume
Guillaume 2018년 7월 16일
Most likely, the problem is with your surfer application. The error message you see comes from Windows, not matlab.
You could see if the invocation works from a different client, e.g. vbscripting host with this VB script
'Save as surfer.vbs in the current matlab folder
Dim objsurf
Set objsurf = CreateObject("surfer.application")
Then in matlab:
dos(sprintf('cscript.exe "%s", fullfile(pwd, 'surfer.vbs')))
The above is equivalent to launching the vb script from a Windows command prompt. Most likely you'll get the same error, indicating that the problem is with surfer.
As for finding the cause of the error, unfortunately it can be anything. Maybe the program is not installed properly, maybe there's a bug in it, maybe it checks for a license which is not present, maybe ...

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Use COM Objects in MATLAB에 대해 자세히 알아보기

태그

제품


릴리스

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by