where can I load windows DLL file

Fridrich Strba fridrich.strba at graduateinstitute.ch
Mon Mar 26 22:53:42 PDT 2012


Let me reply to this a bit more in length.

On 27/03/12 02:45, huqitu du wrote:
> I don't need detect the file format, I only need to know the file
> extension name and if it is .wps(for example abc.wps) when open file
> then lets my DLL function( the function can translate the wps file into
> LO file format) handle it, and the function will make a new file named
> .odt( for example abc.odt) and let's LO reopen the abc.odt file, that's all.

I assume that by WPS you mean Microsoft Works Wordprocessing
file-format. For that one, LibreOffice has an import filter. If it is
not the case, please specify what WPS means for you and we can
investigate more.

Since there is already a file-format that uses *.wps extension and that
is handled by LibreOffice, detecting other unrelated file-format using
the same extension cannot be made using the flat detection, aka
extension only. You will have to first write a proper detection that
will peek the file and unambiguously decide that it is a file your
filter can handle.

In general, having a filter that first converts a document into a
temporary file and then loads the temporary file is not the best idea
and it is indicated to avoid this as much as you can. We have one or two
filters that work like this but it is purely because of licensing issues
that they cannot be used in-process.

Nevertheless, since your DLL as you say can produce a whole file in
OpenDocument format, it should be reasonably easy to produce SAX
messages in flat ODF format. There are helper functions inside
LibreOffice that then allow to serialize such SAX messages and send then
to LibreOffice importer interfaces.

I would love to see where you code is located and can help you with
advice how to integrate it. Nonetheless, if you are really writing
converter for Microsoft Works, it would be the best to simply contribute
to libwps instead of duplicating the work.



More information about the LibreOffice mailing list