« Return to Thread: porting the code from SDK 2.4.1 to SDK 3.1

Re: porting the code from SDK 2.4.1 to SDK 3.1

by Juergen Schmidt-3 :: Rate this Message:

Reply to Author | View in Thread

Hi,

the latest SDK generated all C++ headers in one step automatically. The
first C++ examples that is compiled triggers the generation.

Or manually
cppumaker -Gc -BUCR -O<where you want> .../ure-link/share/types.rdb
.../basis-link/program/offapi.rdb


More interesting for me is how you get the OfficeServiceManager. Your
described behaviour sounds really strange ...


Juergen

Loredan Neagu wrote:

> Hello,
>
>  
>
> A few months ago I developed a Windows application based on
> OpenOffice.org SDK 2.4.1 that supposed to convert any *.odt files to
> .pdf format. The application was written in C++ and I was very excited
> because actually it worked very well.
>
>  
>
> Recently, I have upgraded to OpenOffice.org 3.1 and installed the latest
> SDK. First, I have discovered that when using *cppumaker* application to
> install C++ headers, some of the .hpp and .hdl files were missing.
>
> To install the C++ headers in *includecpp* folder I have used the
> following command:
>
>  
>
> cppumaker -BUCR -O <oo_sdk_path>\includecpp <oo_root>\URE\misc\types.rdb
>
>  
>
> My application uses *XComponentLoader* and *XStorable* interfaces. As
> the XComponentLoader.hpp  and XStorable.hpp  files were missing, I tried
> to compile the XComponentLoader.idl and XStorable.idl files respectively
> using the following command script:
>
>  
>
> idlc -C -I..\idl ..\idl\com\sun\star\frame\XComponentLoader.idl
>
> regmerge XComponentLoader.rdb /UCR
> <oo_sdk_path>\idl\com\sun\star\frame\XComponentLoader.urd
>
> cppumaker -BUCR -O <oo_sdk_path>\includecpp <oo_root>\URE\misc\types.rdb
> <oo_root>\URE\bin\XComponentLoader.rdb
>
>  
>
> idlc -C -I..\idl ..\idl\com\sun\star\frame\XStorable.idl
>
> regmerge XStorable.rdb /UCR <oo_sdk_path>\idl\com\sun\star\frame\
> XStorable.urd
>
> cppumaker -BUCR -O <oo_sdk_path>\includecpp <oo_root>\URE\misc\types.rdb
> <oo_root>\URE\bin\XStorable.rdb
>
>  
>
> Finally, I got the files needed for my application to compile into the
> *includecpp* folder:
>
> #include <com/sun/star/frame/XComponentLoader.hpp>
>
> #include <com/sun/star/frame/XStorable.hpp>
>
>  
>
> Now, I’m experiencing some run-time problems when trying to query for
> XComponentLoader interface:
>
>  
>
> //get the desktop service
>
> Reference< XInterface > Desktop =
> OfficeServiceManager->createInstance(OUString::createFromAscii("com.sun.star.frame.Desktop"));
>
> if(Desktop == NULL || !Desktop.is())
>
> {
>
>    OutputDebugString(_T("Couldn't get the desktop service"));
>
>    return false;
>
> }
>
>  
>
> //query for the XComponentLoader interface
>
> Reference< XComponentLoader > rComponentLoader(Desktop, UNO_QUERY);
>
>  
>
> Error message:
>
> First-chance exception at 0x7c812afb in odt2pdf.exe: Microsoft C++
> exception: com::sun::star::container::NoSuchElementException at memory
> location 0x0121f4e0..
>
> First-chance exception at 0x7c812afb in odt2pdf.exe: Microsoft C++
> exception: com::sun::star::container::NoSuchElementException at memory
> location 0x0121f570..
>
> First-chance exception at 0x7c812afb in odt2pdf.exe: Microsoft C++
> exception: com::sun::star::container::NoSuchElementException at memory
> location 0x0121f404..
>
> First-chance exception at 0x7c812afb in odt2pdf.exe: Microsoft C++
> exception: com::sun::star::container::NoSuchElementException at memory
> location 0x0121f494..
>
> First-chance exception at 0x7c812afb in odt2pdf.exe: Microsoft C++
> exception: com::sun::star::container::NoSuchElementException at memory
> location 0x0121f408..
>
> First-chance exception at 0x7c812afb in odt2pdf.exe: Microsoft C++
> exception: com::sun::star::container::NoSuchElementException at memory
> location 0x0121f498..
>
>  
>
> Furthermore, when I validate the result:
>
>  
>
> if(rComponentLoader == NULL || !rComponentLoader.is())
>
> {
>
>    OutputDebugString(_T("Error: XComponentLoader unsuccessfully
> instanciated\n"));
>
>    return false;
>
> }
>
>  
>
> the application freezes and a stack overflow error message pops up:
>
>  
>
> Is there any SDK installation/configuration step that I have missed?
>
> I really need to fix this issue as soon as possible, so any advice will
> be very much appreciated.
>
>  
>
> Also, is there any way to generate all the C++ source code files from
> the UNO IDL definitions?
>
>  
>
> Thank you for your support,
>
> Loredan Neagu
>
> Software developer
>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@...
For additional commands, e-mail: dev-help@...

 « Return to Thread: porting the code from SDK 2.4.1 to SDK 3.1