This article describes how to integrate the OpenOffice SDK in vs2005.
1. First generate the HPP template header file of the IDL Interface
First, create a includecpp clip under <office-SDK-path>.
"F: \ part _ OpenOffice \ OpenOffice. org3 \ basis \ SDK/bin/cppumaker "-GC-bucr-o" F: \ part _ OpenOffice \ OpenOffice. org3 \ basis \ SDK \ includecpp "" F:/part _ OpenOffice/OpenOffice. org3/ure/MISC // types. RDB "" F:/part _ OpenOffice/OpenOffice. org3/basis/program // offapi. RDB"
Use this command to generate a template file. This command will generate a template file under includecpp.
In addition, do not forget to execute setsdkenv_windows.bat before execution.
There is another method,IsF: \ part _ OpenOffice \ OpenOffice. org3.4 _ SDK \ winexample. Out \ IncCopy the object to includehpp.
Cause:
F: \ part _ OpenOffice \ OpenOffice. org3.4 _ SDK \ winexample. the file in out \ Inc is the same as the file we will generate. The class capacity in this clip is generated when we compile documentloader.
2. Set the relevant path of vs2005
1). Set the executable file directory
F: \ part _ OpenOffice \ OpenOffice. org3 \ Program
F: \ part _ OpenOffice \ OpenOffice. org3 \ ure \ bin
2). Set the inclusion path
F: \ part _ OpenOffice \ OpenOffice. org3 \ basis \ SDK \ include
F: \ part _ OpenOffice \ OpenOffice. org3 \ basis \ SDK \ includecpp
3). Set the library directory
F: \ part _ OpenOffice \ OpenOffice. org3 \ basis \ SDK \ Lib
Directory configuration is complete, we can create a new blank project for testingDocumentloaderFor example:
1) create a blank project oo_test
2) Copy documentloader. cpp to oo_test.
3) add documentloader. cpp to the project.
4) add in PreprocessingXylose; cppu_env = MSCIThese two macros are very important. We need to add them to every project in the future.
5) Add a dependency to the linkIsal. Lib icppu. Lib icppuhelper. Lib isalhelper. Lib ireg. Lib stlport_vc71.lib
Then execute the newly generated oo_test and the documentloader method we generated before execution are the same.
Reference 1: Http://blog.csdn.net/jwybobo2007/article/details/8532226
This article reference 2: http://blog.csdn.net/douyangyang/article/details/4134816