Hi Rick,
rick cameron escribió:
Hi
I'm an absolute newbie at programming against the OOo SDK. I am looking at
the office_connect.cxx sample from the Professional UNO section of the
developer's guide, and trying to build it in Visual C++ 2005.
There is a #include of TypeClass.hdl but this file isn't in C:\Program
Files\OpenOffice.org_2.4_SDK. Where do I find it?
You must dump the headers from the office's type library, using the tool
that comes with the SDK: cppumaker (in SDK\windows\bin\cppumaker.exe).
Supposing you have configured the SDK correctly, you have to do
cppumaker.exe -BUCR -O <API_headers_dump_folder>
<Office_inst_dir>\program\types.rdb
where
* API_headers_dump_folder is the folder where you want all the headers
to be generated
* Office_inst_dir is the directory where OpenOffice.org is installed
(NOT the SDK!)
This will generate in [API_headers_dump_folder] two folders \com and
\drafts, you can delete this last one.
The \com folder has a hierarchical structure including all types
available on your Office installation. For example, the interface
com.sun.star.awt.XWindow will generate two files:
[API_headers_dump_folder]\com\sun\star\awt\XWindow.hdl
[API_headers_dump_folder]\com\sun\star\awt\XWindow.hpp
These last files with the hpp extensions are the ones that you must
include in your code; for example, for using the XWindow interface:
#include <com/sun/star/awt/XWindow.hpp>
The same for the enum TypeClass
(http://api.openoffice.org/docs/common/ref/com/sun/star/uno/TypeClass.html)
and all other types.
For using using OOo API in the Visual Studio, you need to configure it
to find these headers, and the ones in the include dir. on the SDK.
To configure the Visual Studio (explanation only valid for a simple
client application on OOo 2.4, using only OOo UNO API, and linking
agains URE libraries only):
* open the VS "Options" dialog
* select from the tree in the left "Projects and Solutions" -> "VC++
Directories"
* in the listbox "Show direcotires for", select "Include files", and add
- the SDK include directory, and
- the one where you dumped all the office types
* then in the listbox "Show direcotires for", select "Library files",
and add
- C:\Program Files\OpenOffice.org 2.4\program
- C:\Program Files\OpenOffice.org 2.4_SDK\windows\lib
Then for *every* Visual C++ Project you must configure the following
settings:
* in the menu "Project" select "[Your project name] Properties..." (for
me ALT+F7 works)
* for the preprocessor directives: select in the tree "Configuration
Properties" -> "C/C++" -> "Preprocessor". In "Preprocessor Definitions"
add WNT;CPPU_ENV=msci
* in "Configuration Properties" -> "C/C++" -> "Advanced", you may want
to disable some warnings, in "Disable Specific Warnings" type
4251;4275;4290;4675;4786;4800
* in "Configuration Properties" -> "Linker" -> "Command Line", type in
"Addition options"
icppuhelper.lib icppu.lib isalhelper.lib isal.lib
stlport_vc71.lib
For client applications, I use the "New Project" wizard
* choose the "Win32 Console Application" template
* in the "Win32 Application Wizard" press next, and in the step
"Application Settings" choose
Applcation Type -> Console application
Aditional options -> Empty project
this way it won't create the precompiled header stdafx.h
I hope these explanations are complete, as I'm now on Linux and can not
test them (even with lots of RAM, virtualization is a crap... at least
for using the Visual Studio).
If any problem, please let me know, and I send you a Visual Studio
Project (sure you'll have to change it as the directories are in Spanish
["Archivos de Programa", instead of "Program Files", ...])
And by the way, all these is only valid if you want to program with OOo
*API*; if you want to *hack* OOo, you won't need the SDK build
environment, but the build environment used to compile OOo's source code.
And as this mailing list is primary for people working on the source
code, not for only-API-related topics, I would suggest you to subscribe
to the dedicated mailing list for API topics: [EMAIL PROTECTED];
just send a message to [EMAIL PROTECTED] and follow the
instructions in the mail they send you back.
Regards
Ariel.
--
Ariel Constenla-Haile
La Plata, Argentina
[EMAIL PROTECTED]
[EMAIL PROTECTED]
http://www.ArielConstenlaHaile.com.ar/ooo/
"Aus der Kriegsschule des Lebens
- Was mich nicht umbringt,
macht mich härter."
Nietzsche Götzendämmerung, Sprüche und Pfeile, 8.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]