Hi all,
a friend on mine is trying to embed OOo 1.1.3 into a documentation management system developed in Visual Basic.
I state in advance I am not an expert and I'm investigating what is the best way to exploit.
Its problem is to open an OOo instance into a VB form in order to
access documents in different format, i.e to visualize document pages, to zoom into the content, to print and so on.
That is, he would like to access OOo services in Visual Basic as it is
possible in C++.
He tried different ways that are ActiveX, COM, JavaBean as ActiveX control and CLI-UNO bridge. Each way has presented some problems.
1) ActiveX
By using OOo ActiveX component (so_activex.dll) it seems possible to embed OOo. The problem is that very few methods and properties are exposed and there is a lack of documentation about API on how interact with the component.
2) Office automation via COM
We manage to create a Service Manager component representing OOo server which is possible to send commands for document manipulation. The problem is that every document is associated with its external window (not embedded).
If it was possible to capture the window creation and to embed it into the form this will solve the problem
3) Javabean as ActiveX control
We managed to create a JavaBean containing an ActiveX and to register it as DLL (BasicOfficeBean.dll) which is possible, at design type, to integrate into a form. When the program is executed, the ActiveX control is created correctly, but during OOo connection initialization phase, officebean.dll is not found.
BasicOfficeBean.setOfficeConnection(new LocalOfficeConnection());
public synchronized void setOfficeConnection(OfficeConnection aConn)
throws java.lang.IllegalStateException
{
...
// mConnection = NewLocalOfficeConnection();
mConnection = a Conn ;
mConnection.addEventListener(new ConnectionListener());
}The bean initialitazion procedure tries to create a connection to the local server using the code in officebean.jar. This calls the function LocalOfficeConnection() and in its turn try to load officebean.dll into its contructor
public LocalOfficeConnection()
{
try
{
setUnoUrl( "uno:pipe,name=" + getPipeName() +
";urp;StarOffice.Servicemanager");
}
catch ( java.net.MalformedURLException e )
{}
// load libofficebean.so/officebean.dll
String aSharedLibName = getProgramPath() +
java.io.File.separator +
System.mapLibraryName(OFFI_LIB_NAME);
System.load( a SharedLibName ) ;// System.load("C:\\ooo1.1.3\\program\\officebean.dll");Effectively installation directory of OOo is not found so it's not possible to load the DLL. It seems that getProgramPath returns a void string.
4) CLI-UNO Bridge
We tried to use CLI-UNO bridge. There are 4 DLLs to reference into .NET project. Unfortunately the documentation it's not clear about what it's possible to do with the exposed namespaces and it's not clear if it is possible to create a Window object to be embed into a form. Even if it's seems very promising some substantial improvements are previewed for the 2.0 and this way could bring to write code not reusable with the new version.
Thanks in advance for any suggestion
Davide
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
