Passing existing COM server to parallel cluster

2 ビュー (過去 30 日間)
Sergio De Zordo
Sergio De Zordo 2014 年 2 月 13 日
回答済み: Edric Ellis 2014 年 2 月 13 日
Hi,
I'm wondering whether an existing COM server, invoked by something like
Excel=actxserver('excel.application');
can be passed to a local parallel cluster as an argument of a Matlab function via the createtask command, say as in
cluster=parcluster;
job=createJob(cluster);
createTask(job,@genericFunction,1,{arg1,arg2,Excel});
submit(job)
wait(job)
results=fetchOutputs(job);
I tried this, and noticed that (in Win Task Manager) the slave opens up another COM server -- which is not what I'm looking for.
Any ideas?
Thanks in advance,
Sergio

回答 (1 件)

Edric Ellis
Edric Ellis 2014 年 2 月 13 日
You need to use actxGetRunningServer on the workers rather than passing the server object directly, like so:
>> e = actxserver('Excel.application')
e =
COM.Excel_application
>> e.Hwnd
ans =
199964
>> c = parcluster('local');
>> j = batch(c, 'myE = actxGetRunningServer(''Excel.appliction''); myE.Hwnd');
>> wait(j);
>> diary(j)
--- Start Diary ---
ans =
199964
--- End Diary ---

カテゴリ

Help Center および File ExchangeUse COM Objects in MATLAB についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by