OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

registry database filename truncated in C++

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API
View previous topic :: View next topic  
Author Message
Omar
Power User
Power User


Joined: 24 Aug 2004
Posts: 85

PostPosted: Tue Jan 11, 2005 12:36 pm    Post subject: registry database filename truncated in C++ Reply with quote

I've run across an odd error involving the OpenOffice.org registry database and was hoping that someone else may have had a similar experience and knows of a solution. The registry database file is created at /office/DocumentConversion.rdb using the regmerge and regcomp programs in the <OOo_HOME>/linux/bin directory of the SDK. When my main program tries to access the registry database in order to convert some documents, the program crashes. I put in some debugging info and found that it crashes when trying to open the registry with the following command where REGISTRY_DATABASE is a string set to "/office/DocumentConversion.rdb":
Code:

xSimpleRegistry->open( OUString( RTL_CONSTASCII_USTRINGPARAM(string(REGISTRY_DATABASE).c_str()) ), sal_True, sal_False);


Doing an strace on the execution showed me that the program first opens and closes '/office/DocumentConversion.rdb" then attempts to open the file "/of" and crashes. I tried changing the REGISTRY_DATABASE variable to "/root/registry.rdb" and the system then opened/closed "/root/registry.rdb" then tried to open "/ro" and crashes.

The only work-around I've found so far is to either copy the registry to both "/office/DocumentConversion.rdb" and "/of" or create a symbolic link that points "/of" to "/office/DocumentConversion.rdb". With the work-around in place the program works fine and the database is loaded correctly. The other option I've found that works is to set the REGISTRY_DATABASE variable to a 3 character file name. Thus the file location isn't affected when the file name is truncated down to three characters.

I've run the code on two development machines, one with OpenOffice.org 1.1.3 and the other with OpenOffice.org 1.1.4 and the error crops up on both. I haven't tried regressing as far back as OpenOffice.org 1.1.2.

Both systems are Linux boxes running Fedora Core 3 with gcc 3.3 compatability since gcc 3.4 isn't supported by the OOo SDK.

-Omar
Back to top
View user's profile Send private message
SergeM
Super User
Super User


Joined: 09 Sep 2003
Posts: 3211
Location: Troyes France

PostPosted: Wed Jan 12, 2005 8:56 am    Post subject: Reply with quote

I will work around registery, but for now I am not enough advanced to give you an answer Embarassed
_________________
Linux & Windows OOo3.0
UNO & C++ : WIKI
http://wiki.services.openoffice.org/wiki/Using_Cpp_with_the_OOo_SDK
In French
http://wiki.services.openoffice.org/wiki/Documentation/FR/Cpp_Guide
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group