the excerpt in C# is:
...
unoidl.com.sun.star.uno.XComponentContext localContext =
uno.util.Bootstrap.bootstrap();
unoidl.com.sun.star.lang.XMultiServiceFactory multiServiceFactory =
(unoidl.com.sun.star.lang.XMultiServiceFactory)
localContext.getServiceManager();
...
what it will be like in MatLAB? The deadlock is class definition of
variable. Writing the sentences as:
localContext = uno.util.Bootstrap.bootstrap();
multiServiceFactory = localContext.getServiceManager();
fails, approximatelly saying 'no such method' (sorry, but the
NET.addAssembly() code is not working in x64 arch, so i can't reproduce
it right now).
--
ejs
-Fazil
"ejs" <e...@seniejitrakai.net> wrote in message
news:4d3ca7ce$0$23756$1472...@news.sunsite.dk...
What i'm trying to achieve is controlling OpenOffice.org from MatLAB, so
the .NET code is running from MatLAB side.
I hope to write 'odswrite' ;)
--
ejs
??? Message: Could not load file or assembly 'cli_cppuhelper,
Version=1.0.21.0,
Culture=neutral, PublicKeyToken=ce2cb7e279207b9e' or one of its
dependencies. The
system cannot find the file specified.
Source: mscorlib
HelpLink:
The file exists, test program in C# from
http://ejs.seniejitrakai.net/2011/01/23/openoffice-org-x64-and-net-interface/
( http://ejs.seniejitrakai.net/njufsams/OpenOfficeTestApp.exe ) works
fine both in x32 and in x64 architectures.
The assembly is targeted to x32 architecture, but it's not a problem for
standalone application.
the MatLAB code:
if ~exist('OOorgBase')
str = computer;
if (strcmpi('pcwin',str(1:5)))
if ((size(str,2) == 7) && (strcmp('64',str(6:7))))
basekey = 'Software\Wow6432Node\OpenOffice.org';
else
basekey = 'Software\OpenOffice.org'; % for 32 bits
end
UREkey = '\Layers\URE\1';
UNOkey = '\UNO\InstallPath';
OOorgBase = winqueryreg( 'name', 'HKEY_LOCAL_MACHINE', ...
basekey);
OOorgURE = winqueryreg('HKEY_LOCAL_MACHINE', [basekey UREkey],
'UREINSTALLLOCATION');
OOorgURE = [OOorgURE 'bin\'];
OOorgUNO = winqueryreg('HKEY_LOCAL_MACHINE', [basekey UNOkey], '');
cPath = getenv('PATH');
cPath = [cPath '; ' OOorgURE];
setenv('PATH', cPath);
setenv('UNO_PATH', OOorgUNO);
end % if PCWIN
end % if OOorgBase is undefined
asy=NET.addAssembly('cli_basetypes');
asy=NET.addAssembly('cli_oootypes');
asy=NET.addAssembly('cli_ure');
asy=NET.addAssembly('cli_uretypes');
asy=NET.addAssembly('cli_cppuhelper');
--
ejs