Re: [dev] OO 3.0, COM, loadComponentFromURL, readOnly ever .... :-(
Stephan Bergmann schrieb: On 12/15/08 20:44, Marten Feldtmann wrote: | writerDocument | writerDocument := aMSKOO desktop loadComponentFromURL: 'file:///c:\test.odt' string TargetFrameName: '_blank' string SearchFlags: 0 long Arguments: Array new. The only thing that catches my eye is the wrong \ (vs. /) in the file URL (but I doubt that is of relevance here). Wooow ! Amazing ! That was it ! Using 'file:///c:\test.odt' and it is opened readonly. Using 'file:///c:/test.odt' and its working without problems !! I knew that it was not following the standard, but 2.4.x accepted it ... Congratulations and many thanks ! On the other side: It works now but actually it seems a little suspect, that such a difference has such a strange impact on the working model ... perhaps it would be better so throw an exception .. But ok it's working now and I updated my issue Marten Feldtmann - To unsubscribe, e-mail: dev-unsubscr...@openoffice.org For additional commands, e-mail: dev-h...@openoffice.org
Re: [dev] OO 3.0, COM, loadComponentFromURL, readOnly ever .... :-(
Mikhail Voitenko schrieb: Hi Marten, As Mathias has written it would really help if you provide the code snippet related to parameters generation of the call. There is currently no known problem in this area, thus the scenario you are using should have a specific that let the problem be reproducible. And to detect what goes wrong we need a possibility to reproduce the problem. Ok, here is the Smalltalk code I execute. The smallest code I can execute on the Smalltalk side to get the error is: | writerDocument | writerDocument := aMSKOO desktop loadComponentFromURL: 'file:///c:\test.odt' string TargetFrameName: '_blank' string SearchFlags: 0 long Arguments: Array new. This code returns a valid OLE object (and opens a document), but the document is read-only. The file is indeed opened readonly - because not lock files are shown in this directory and I can open the file without problems via OpenOffice-application. I could change the code to: | writerDocument | writerDocument := aMSKOO desktop loadComponentFromURL: 'file:///c:|test.odt' string TargetFrameName: '_blank' string SearchFlags: 0 long Arguments: Array new. and I get an exception with content com.sun.star.lang.IllegalArgumentException: URL seems to be an unsupported one. This shows, that the stuff is at least something doing. Then I changed the code to actually use parameters: In this document I used the attribute Hidden and I set it to true and this also worked very well. I get a valid OLE object back and the file seems to be opened readonly but hidden: | writerDocument aProperty | aProperty := OOBeansPropertyValue ooNew: aMSKOO. aProperty name: 'Hidden' ; value: true. writerDocument := aMSKOO desktop loadComponentFromURL: 'file:///c:\test.odt' string TargetFrameName: '_blank' string SearchFlags: 0 long Arguments: (Array with: aProperty). ^writerDocument To verify that the boolean parameters are evaluated I change the last code to: | writerDocument aProperty | aProperty := OOBeansPropertyValue ooNew: aMSKOO. aProperty name: 'Hidden' ; value: false. writerDocument := aMSKOO desktop loadComponentFromURL: 'file:///c:\test.odt' string TargetFrameName: '_blank' string SearchFlags: 0 long Arguments: (Array with: aProperty). ^writerDocument and the document is opened visible again (readonly). Then I change the code (now we are coming to the ReadOnly attribute) to: | writerDocument aProperty | aProperty := OOBeansPropertyValue ooNew: aMSKOO. aProperty name: 'READONLY' ; value: false. writerDocument := aMSKOO desktop loadComponentFromURL: 'file:///c:\test.odt' string TargetFrameName: '_blank' string SearchFlags: 0 long Arguments: (Array with: aProperty). ^writerDocument and the document is again opened visible readonly. The system does not recognize the 'READONLY' parameter - fine.Therefore I change it to: | writerDocument aProperty | aProperty := OOBeansPropertyValue ooNew: aMSKOO. aProperty name: 'ReadOnly' ; value: false. writerDocument := aMSKOO desktop loadComponentFromURL: 'file:///c:\test.odt' string TargetFrameName: '_blank' string SearchFlags: 0 long Arguments: (Array with: aProperty). ^writerDocument On the lowest level side i get an object *OSVariantarg { vt: 13 wReserved1: 0 wReserved2: 0 wReserved3: 0 } which is an pointer to an OSVariantarg structure. The 13 means VtUnknown. If I change the code to | writerDocument aProperty | aProperty := OOBeansPropertyValue ooNew: aMSKOO. aProperty name: 'ReadOnly' ; value: true writerDocument := aMSKOO desktop loadComponentFromURL: 'file:///c:\test.odt' string TargetFrameName: '_blank' string SearchFlags: 0 long Arguments: (Array with: aProperty).
Re: [dev] OO 3.0, COM, loadComponentFromURL, readOnly ever .... :-(
Ok, I did some further tests: a) deinstalled the 3.0.0 and installed the newest developer build - same error. b) deinstalled the developer build and installed OO 2.4.1 and my software worked without problems It's not a feature ... perhaps just a nasty little bug in the OLE bridge ??? Marten Mathias Bauer schrieb: Marten Feldtmann wrote: I did some tests with that API call and whatever I do: the document is always opened readOnly. - when I open the document using OpenOffice 3.0 via dialog, the document opens the normal way: writeable - when using the API call I always get a write protected document - when I use the property ReadOnly and do set it to true I get a write protected document (thats ok ...) - when I use the property ReadOnly and do set it to false I get a VT_UNKNOWN value from the loadComponentFromURL call. Then I thought, that perhaps the parameter handling was wrong and created an empty document (via factory) and used the attribute Hidden and that work well. Therefore I think, that my parameter handling seems to be correct. Any idea ??? It would perhaps help if you posted a code snippet showing the parameters you use and the call itself. Besides that the only idea I have is that the document might be open already. Regards, Mathias - To unsubscribe, e-mail: dev-unsubscr...@openoffice.org For additional commands, e-mail: dev-h...@openoffice.org
Re: [dev] getTextFields() - where to get additional infos
Nice, but this was NOT my question. If you get the information, that the resulting object is of kind com.sun.star.text.TextFields , then I'm also fine, because my code also gives me all the needed information I wanted to have. The question was: how do I find out this information, that the returned object is of that kind and I tried to show, that this information seems to be not available by reading the IDL reference documentation. Regarding the Smalltalk interface: though I generated code for nearly the whole office suite I concentrate on the Writer part now trying to find an easy programming model. The good thing is, that I do not have to convert or request all these interfaces - the methods are there point. I'm actually using my Smalltalk code to find out how it works, write small programs and then reused this knowledge when doing C# stuff. Actually I'm fine tuning the code generator now and some stuff is still missing - due to lack of knowledge regarding OLE stuff. Some points: * I'm able to convert a sequence (from OLE objects) to Smalltalk objects, bit I have not found out the other way. That means, that some of the generated code having sequences as parameters simply do not work * Who is responsible for the memory management. I expect to have memory leaks - but I do not know, how to fix them right now. The best thing would be to have a native UNO C bridge I could use, but this area seems to be very limited documented. Marten rony schrieb: Hi Marten, Yes, these are hints, but you do not get this information from the IDL reference and it seems to be impossible to get this information via reflection. I created now around 3000 classes from doing reflection of the whole system and can't get this information. The following is an interactive session (starting ooRexx in a command line window, loading the uno/OOo support by calling the module uno.cls and then querying the definition of the service com.sun.star.text.TextFields using the IDL name) on Windows XP: F:\test\ooorexxtry REXX-ooRexx_3.2.0(MT) 6.02 16 Jun 2008 rexxtry.rex lets you interactively try REXX statements. Each string is executed when you hit Enter. Enter 'call tell' for a description of the features. Go on - try a few...Enter 'exit' to end. call uno.cls ... rexxtry.rex on WindowsNT str=com.sun.star.text.TextFields ... rexxtry.rex on WindowsNT say ppd(uno.getDefinition(str)) UNO_SERVICE|com.sun.star.text.TextFields| com.sun.star.container.XEnumerationAccess|UNO_INTERFACE||com.sun.star.text.TextFields com.sun.star.util.XRefreshable|UNO_INTERFACE||com.sun.star.text.TextFields ... rexxtry.rex on WindowsNT So the XRefreshable interface gets listed, and very easily so... :) --- Behind the curtains the UNO reflection mechanism is used to get to the information. Wrote a Java wrapper for it, which encodes the results in form of a string, that can be easily parsed according to p.2. on http://wi.wu-wien.ac.at/rgf/rexx/bsf4rexx/current/refcardOOo.pdf, right-most column, section entitled Table “UNOIDL String Encodings”. If you can interface with Java behind the curtain from Smalltalk then please say so and I will direct you to where to get that Java wrapper class (it took me *quite* some efforts to create it, but it works on all platforms: Linux, Macs, and Windows), which may help you as well in your efforts. ---rony P.S.: Of course I am always interested in seeing the Smalltalk snippets from time to time to relate to another posting of yours... - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [dev] getTextFields() - where to get additional infos
Yes, these are hints, but you do not get this information from the IDL reference and it seems to be impossible to get this information via reflection. I created now around 3000 classes from doing reflection of the whole system and can't get this information. Marten rony schrieb: Hi Marten, just guessing. Marten Feldtmann wrote: How can this code run: ((mxDocument as XTextFieldsSupplier).getTextFields() as XRefreshable).refresh(); getTextFields() (by interface XTextFieldsSupplier) delivers com.sun.star.container.XEnumerationAccess and this interface does not understand refresh. Where in the idl reference do I get the information, that getTextFields() actually delivers an instance of com.sun.star.text.TextFields ? I do not get this information via the idl reference, nor by reflection Going to http://api.openoffice.org/docs/common/ref/com/sun/star/util/XRefreshable.html and choosing Use in the top menu, you get to http://api.openoffice.org/docs/common/ref/com/sun/star/util/XRefreshable-xref.html, where you see a reference to http://api.openoffice.org/docs/common/ref/com/sun/star/sdbcx/Container.html. From http://wiki.services.openoffice.org/wiki/Documentation/DevGuide/ProUNO/Collections_and_Containers it seems that XEnumerationAccess is a subclass of XContainer and as such possesses the XRefreshableInterface, which you then would neet to query explicitly from the XEnumerationAcess object. HTH, ---rony - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[dev] getTextFields() - where to get additional infos
How can this code run: ((mxDocument as XTextFieldsSupplier).getTextFields() as XRefreshable).refresh(); getTextFields() (by interface XTextFieldsSupplier) delivers com.sun.star.container.XEnumerationAccess and this interface does not understand refresh. Where in the idl reference do I get the information, that getTextFields() actually delivers an instance of com.sun.star.text.TextFields ? I do not get this information via the idl reference, nor by reflection Marten Feldtmann - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[dev] OO 3.0, COM, loadComponentFromURL, readOnly ever .... :-(
I did some tests with that API call and whatever I do: the document is always opened readOnly. - when I open the document using OpenOffice 3.0 via dialog, the document opens the normal way: writeable - when using the API call I always get a write protected document - when I use the property ReadOnly and do set it to true I get a write protected document (thats ok ...) - when I use the property ReadOnly and do set it to false I get a VT_UNKNOWN value from the loadComponentFromURL call. Then I thought, that perhaps the parameter handling was wrong and created an empty document (via factory) and used the attribute Hidden and that work well. Therefore I think, that my parameter handling seems to be correct. Any idea ??? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [dev] CLI - how to deploy, hoe does it works ?
The first problem is the loading of libraries via .NET. This happens on a lazy base - when calling uno.util.Bootstrap.bootstrap(); On some machines I get errors (FileNotFound exceptions), some are working without problems. This can be solved by adding the installation path to the PATH variable. This must be done by the application program. UNO_PATH does not help, because setting this will add the content of UNO_PATH to PATH, but AFTER .NET has loaded all libraries needed. The other problems are based on wrong registry entries (some from old installations). To reduce these problems, one may set UNO_PATH, which prevents, that OO looks into the registry at all. On the other hand you may end up with two OO paths in your PATH variable. I've written a small console based program, which connects to OpenOffice in six different way - nice program to check a computer very fast, if the OO connection works using .NET. The project (including binary) can be downloaded from www.schrievkrom.de/extfiles/OOConsoleTest.zip and is about 30K small. I now only have to solve the problem with a new XP installation on a laptop, where 2.3.0 is installed, but when bootstrap that it does not find the specific version Marten - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [dev] CLI - how to deploy, hoe does it works ?
Joachim, this is a total mess. I've got now three additional machine (older W2000 and one brand new XP installation) to get the software to work and on none of these machine did the software work. On one W2000 machine I've found an old OO 1.1.4 installation (which was not able to uninstall itself) and manually deleting lots of OpenOffice regitry entries I managed to get my 2.3.0 OO to run with my software. The other W2000 machine is still not working and the XP-SP2 machine, I do not know - this is a total unstable way to do programming with .NET and OpenOffice. The only reliable way to get it all working is to start my application within the OO program directory (which is not a nice idea). Pretty bad ... - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [dev] CLI - how to deploy, how does it works ?
Could you delete the key and run the test again? (Assuming that you have uninstalled your user - only office anyway) Well done - that was it ! Thank you very much ! Marten - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [dev] CLI - how to deploy, hoe does it works ?
Hello Joachim, I've already found and looked at the policy files. They are all there and they seem to work as expected. All libraries are in the GAC And in my last posting I also did all the other attempts to make it work: I also tried NOT to deliver the libraries with my applications. But from your answer I get several results: * do not deliver new OO libraries with own application * But - I'm not totally sure about that - my application tried to start and asked the .NET framework about 1.1.10.0 (as an example), which is delivered with OO 2.3 - but the target machine has only OO 2.2 and therefore only 1.1.7.0 AND rebinding instructions for 1.1.1.0 - 1.1.6.0 to 1.1.7.0. What is happing in case of such a request ? Within VS2005 I told the application not to use strict versions - but this does not seem to help. Please read my posting again - I've tried several cases and even the OO 2.3 (source) - OO 2.3 (target) ONLY works, when I change the PATH variable and OO 2.3 (source) - OO 2.2 (target) does not work at all. That it works on my (office) machine is perhaps pure luck, because it has the oldest installation and there was so much work done with .NET configuration - but all other machines I tried out are fresh installed machines where nothing has been changed in the .NET configuration. I'm now at home (using VISTA) trying to get my own application to run - but no chance - always getting a System.Runtime.InteropServices.SEHException: Eine externe Komponente hat eine Ausnahme ausgelöst. bei cppu.bootstrap(Referencecom::sun::star::uno::XComponentContext* ) bei uno.util.Bootstrap.bootstrap() bei OpenOffice.GeneralDocHelper.connect(String[] args) in But now looking again at this code (while writing this) I get another idea - this is a security exception ! Some code is executed, which does not allowed things - I got this exception (as an example) when trying to read the registry keys values from the registry (as a normal user under windows): to find out, where OO is installed. Remember: my applications are only some files within a directory. They are not installed using some kind of installer or stuff like this - I'm not an expert in this security area. But this does not answer my other question: interoperability with OO 2.3 development and OO 2.2 runtime. Marten Joachim Lingner schrieb: Hi Marten, Marten Feldtmann wrote: Ok, I try to give some more information. On my development machine I have .NET 1.1, .NET 2.0 and .NET 3.0 installed. On this machine I use OO 2.3 and all development is done using OO 2.3. I use OO to create documents on demand and on my machine everything is working as expected. Original on the target machine was only .NET 2.0 but I also installed .NET 1.1 on that machine. Installed was also OO 2.2. I've several machines like this in our network ... and all have the same behaviour. If I deploy my application I've learned, that I have to deliver my versions of (based on OO 2.3) the following four libraries: * cli_basetypes.dll (1.0.7.0), * cli_cppuhelper.dll (1.0.10.0), * cli_types.dll (1.1.10.0), * cli_ure.dll (1.0.10.0) I have a very simple deployment - I put all my files into a single directory and add these four libraries to this directory. This should not be necessary since OOo installs the libraries into the GAC. This is also dangerous because a new OOo version typically brings new types in cli_types.dll. When these are transferred to the client which uses an old cli_types.dll then the CLI-UNO bridge certainly terminates. If I do NOT add these libraries, the .NET (e.g.) gets a request to bind version 1.1.10.0 of cli_types.dll and it fails, because it has only version 1.1.7.0 (the version from from OO 2.2) and there are no rebinding instructions to rebind all the stuff to version x (based on OO 2.3). With every new version of OOo the assembly versions are incremented. Nowclient programs build with previous programs would not run anymore. Therefore OOo also installs a policy assembly for each assembly, for example policy.1.1.cli_types.dll which does a binding redirect for the assembly. That is, the runtime is told to use version 1.1.10 although your assembly was build with 1.1.7. Here is an example of a policy configuration file: ?xml version=1.0? configuration runtime assemblyBinding xmlns=urn:schemas-microsoft-com:asm.v1 dependentAssembly assemblyIdentity name=cli_types publicKeyToken=ce2cb7e279207b9e/ bindingRedirect oldVersion=1.1.0.0-1.1.10.0 newVersion=1.1.11.0 / /dependentAssembly /assemblyBinding /runtime /configuration Please look in your GAC if all four policy assemblies are available. The policy configuration files can be found as plain text in the GAC, for example C:\WINDOWS\assembly\GAC\policy.1.1.cli_types\9.0.0.0__ce2cb7e279207b9e\cli_types.config CLI programs can be configured to use or not use publisher policy files. This can be done
Re: [dev] CLI - how to deploy, hoe does it works ?
I did an uninstallation and then: I've installed OO 2.3 for the current user (which is always admin - because one needs to have administration right) and then it works (under admin) without further work. I've installed OO 2.3 for all users and it does not work (wether admin nor me) and generates the Context error message I mentioned in the earlier postings. By the way - here is another person having this problem (posted 13/11/2007): http://www.oooforum.org/forum/viewtopic.phtml?t=65594 Marten - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [dev] CLI - how to deploy, hoe does it works ?
Ok, I try to give some more information. On my development machine I have .NET 1.1, .NET 2.0 and .NET 3.0 installed. On this machine I use OO 2.3 and all development is done using OO 2.3. I use OO to create documents on demand and on my machine everything is working as expected. Original on the target machine was only .NET 2.0 but I also installed .NET 1.1 on that machine. Installed was also OO 2.2. I've several machines like this in our network ... and all have the same behaviour. If I deploy my application I've learned, that I have to deliver my versions of (based on OO 2.3) the following four libraries: * cli_basetypes.dll (1.0.7.0), * cli_cppuhelper.dll (1.0.10.0), * cli_types.dll (1.1.10.0), * cli_ure.dll (1.0.10.0) I have a very simple deployment - I put all my files into a single directory and add these four libraries to this directory. If I do NOT add these libraries, the .NET (e.g.) gets a request to bind version 1.1.10.0 of cli_types.dll and it fails, because it has only version 1.1.7.0 (the version from from OO 2.2) and there are no rebinding instructions to rebind all the stuff to version x (based on OO 2.3). The result is a simple error message on the target machine: System.IO.FileNotFoundException: Die Datei oder Assembly cli_types, Version=1.1.10.0, Culture=neutral, PublicKeyToken=ce2cb7e279207b9e oder eine Abhängigkeit davon wurde nicht gefunden. Das System kann die angegebene Datei nicht finden. Dateiname: cli_types, Version=1.1.10.0, Culture=neutral, PublicKeyToken=ce2cb7e279207b9e bei OpenOffice.TextDocHelper..ctor(Boolean hiddenFlag) = If I add these libraries the .NET framework searches in the executing directory and find my deployed versions of these dll's and seems to bind them but errors come later on the target machine: System.Runtime.InteropServices.SEHException: Eine externe Komponente hat eine Ausnahme ausgelöst. bei cppu.bootstrap(Referencecom::sun::star::uno::XComponentContext* ) bei uno.util.Bootstrap.bootstrap() bei OpenOffice.GeneralDocHelper.connect(String[] args) in D:\programmierung\ES2005-1\OpenOfficeConnection\OpenOfficeConnection\GeneralDocHelper.cs:Zeile 55. bei OpenOffice.GeneralDocHelper..ctor(Boolean hiddenFlag) in D:\programmierung\ES2005-1\OpenOfficeConnection\OpenOfficeConnection\GeneralDocHelper.cs:Zeile 35. bei OpenOffice.TextDocHelper..ctor(Boolean hiddenFlag) in D:\programmierung\ES2005-1\OpenOfficeConnection\OpenOfficeConnection\TextDocHelper.cs:Zeile 25. (does not matter if admin or normal user) = If I add the OpenOffice 2.2 installation path (...\program) to PATH I get a different error on the target machine: unoidl.com.sun.star.uno.RuntimeException: [map_to_uno():[]com.sun.star.beans.PropertyValue] conversion failed [map_to_uno():unoidl.com.sun.star.beans.PropertyValue.Value [map_to_uno():any] could not convert type! Server stack trace: Exception rethrown at [0]: bei System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) bei System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData msgData, Int32 type) bei unoidl.com.sun.star.frame.XComponentLoader.loadComponentFromURL(String URL, String TargetFrameName, Int32 SearchFlags, PropertyValue[] Arguments) bei OpenOffice.TextDocHelper.initDocument(Boolean hiddenFlag) in D:\programmierung\ES2005-1\OpenOfficeConnection\OpenOfficeConnection\TextDocHelper.cs:Zeile 93. bei OpenOffice.TextDocHelper..ctor(Boolean hiddenFlag) in D:\programmierung\ES2005-1\OpenOfficeConnection\OpenOfficeConnection\TextDocHelper.cs:Zeile 28. = Then I installed OO 2.3 on the target machine (changed the PATH variable to the original content - this means: NO OO 2.3 in the path) and get the same XComponentContext exception as mentioned above. = Then I change the PATH variable to point to the OO 2.3 directory (..\program\) all is working. = Following my experience on some other machines here I have to make sure, that ALL machines have OO 2.3 and PATH must include the OO2.3 program directory and then the stuff may work. Another problem here is, that it is not possible to retrieve the installation path of OO 2.3 when working as a normal user - the security issues with that simple deployment do not allow this. After all I would say, that the whole deployment for .NET based system concerning OpenOffice simply does not work. But perhaps you have some hints to make this work ... Marten - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[dev] CLI, TextTable and Cells - why can I not set property values ?
This is an extract of my code - I do not know, why the last code line always fails any ideas ? unoidl.com.sun.star.beans.XPropertySet propSet = null; // We get a single cell which works without problems ... unoidl.com.sun.star.table.XCell cell = ((unoidl.com.sun.star.table.XCellRange)aXTextTable).getCellByPosition(1,1); // THis property value setting (based on tables) works also ((unoidl.com.sun.star.beans.XPropertySet)aXTextTable).setPropertyValue( BackColor, new uno.Any(0xAA)); // Now we try to work based on cells ... propSet = (unoidl.com.sun.star.beans.XPropertySet) cell; // This always breaks and raises UnknownPropertyException // ... but single cells should have this property ... propSet.setPropertyValue( HoriJustify, new uno.Any((ushort)unoidl.com.sun.star.table.CellHoriJustify.LEFT)); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [dev] OLE, data type hyper and returned vt value !?
Joachim Lingner schrieb: In case there are no 100% equivalent types in two different type systems (oleautomation UNO) one has to tweak a little. The Decimal should cover the value space of a hyper and can therefore be used on the oleautomation side when calling an UNO method which requires an hyper argument. And yes, I noticed my fault again ... the returned 14 value IS VT_DECIMAL ... apologize for my misunderstanding Marten - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [dev] OLE, data type hyper and returned vt value !?
Joachim Lingner schrieb: Hi Marten, Marten Feldtmann wrote: When running around in the reflection system of OpenOffice 2.x I came across the following problem: Some constants have adefined data type hyper, which means signed 64 bit values. When I query the value for that constant I get a dispatched (is this the right name) with a vt type = 14. I ran around and looked for that definition: 14 and found in my development tool and some texts from Microsoft, that the value for signed 64-bit values is 0x14 - which means 20 and not 14. Int 64 is no valid automation type: http://msdn2.microsoft.com/en-us/library/aa367129.aspx Therefor Decimal should be used. See Developers Guide: http://api.openoffice.org/docs/DevelopersGuide/ProfUNO/ProfUNO.xhtml#1_4_4_7_Type_Mappings paragraph: Mapping of hyper and Decimal. Since automation bridge converts the arguments to the expected type it should also be possible to provide 16 or 32 bit integers where a hyper is expected. Then it is a bug within the automation bridge ... as an example: com.sun.star.embed.Aspects Marten - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [dev] Custom data inside OpenDocument
The method metioned below is part of the beansXPropertyContainer interface and should be available under DocumentInfo Marten Robert Vojta schrieb: On 10/15/07, Mathias Bauer [EMAIL PROTECTED] wrote: Hallo, You have to add the property before you can assign it a value: So, when I call setPropertyValue in Java and property wasn't added previously, it should raise UnknownPropertyException exception. If yes, this exception isn't raised here on my computer and I assume it's a bug. ThisComponent.DocumentInfo.AddProperty(aCustomProperty, com.sun.star.beans.PropertyAttribute_REMOVABLE, defaultval) ThisComponent.DocumentInfo.SetPropertyValue(aCustomProperty, a Custom Value) It's important to use the REMOVABLE attribute so that it is immediately discernible that this property is not a built-in one. It works in StarBasic, thanks. But where I can found addProperty in Java? I can't find similiar method in XDocumentInfo, XPropertySet, ... - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[dev] OLE, data type hyper and returned vt value !?
When running around in the reflection system of OpenOffice 2.x I came across the following problem: Some constants have adefined data type hyper, which means signed 64 bit values. When I query the value for that constant I get a dispatched (is this the right name) with a vt type = 14. I ran around and looked for that definition: 14 and found in my development tool and some texts from Microsoft, that the value for signed 64-bit values is 0x14 - which means 20 and not 14. And by the way this is only supported by XP and later ... - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[dev] How to get the supported interfaces of an unknown object ?
All I would like to have is a way to implement: anObject.SupportsInterfacesNamed(com.sun.star.reflection.XTypeDescription) which may returns true or false and this via UNO calls and not via BASIC special calls (to use it under OLE). I thought, that perhaps queryInterface might help me, but I do not understand type and how to get the type for a name like com.sun.star.reflection.XTypeDescription ? Marten - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [dev] How to get the supported interfaces of an unknown object ?
Stephan Bergmann schrieb: Marten Feldtmann wrote: All I would like to have is a way to implement: anObject.SupportsInterfacesNamed(com.sun.star.reflection.XTypeDescription) See com.sun.star.lang.XTypeProvider, which should be implemented by every UNO object (but probably isn't for some). Then we are in a circle :-) - XTypeProvider may return you some information about an object and returns an instance, which supports at least com.sun.star.reflection.XTypeDescription - but how is it going on then ? I want to query the returned instance, if it implements additional interfaces - just to know how to react - therefore the example above ... To summarize - in the example above anObject is an object which at least implements com.sun.star.reflection.XTypeDescription - but does it also implements additional interfaces ? This problem arrises, if you work with the enumeration you may receive from *createTypeDescriptionEnumeration. * You may work around this particular problem, by querying the typeClass - but I do not see a general solution for this problem ... In StarBasic this feature seems to be called: HasUnoInterface(object, string) .. ** which may returns true or false and this via UNO calls and not via BASIC special calls (to use it under OLE). I thought, that perhaps queryInterface might help me, but I do not understand type and how to get the type for a name like com.sun.star.reflection.XTypeDescription ? queryInterface (although erroneously mentioned in the language-independent XInterface.idl) is language-binding--specific functionality. Which language are you talking about (Java, C++, etc.)? I'm looking for OLE ... Marten - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [dev] OLE, Source code generation and reflection ... the boring story ...
Stephan Bergmann schrieb: Marten Feldtmann wrote: What a nonsense ... the BASIC program is the following and I think, that it does pretty much the same as done in climaker IIRC, at least a long time ago there were problems with createTypeDescriptionEnumeration and particular arguments to it. Did you experiment whether using other arguments (an explicit module name, an empty valueArray, 1 instead of -1) helps? Sorry I cannot remember more details, or even an issue ID. After asking google I found out, that such a discussion was hold around Juli 2005 with the same content between you and Arnulf Wiedemann. I'm just reading it, what that all means ... Marten - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [dev] OLE, Source code generation and reflection ... the boring story ...
And Jürgen Schmidt answered this question around August-2005. Here is the corrected code for the problem .. Sub MyReflectionTest Dim enumeration as Object Dim typeDescription as object dim valueArray(0) dim level valueArray(0) = com.sun.star.uno.TypeClass.SERVICE servicemgr = getProcessServiceManager() tdmgr = servicemgr.DefaultContext.getValueByName(/singletons/com.sun.star.reflection.theTypeDescriptionManager) if not IsNull(tdmgr) then enumeration = tdmgr.createTypeDescriptionEnumeration(com.sun.star.reflection, valueArray, 1) if not isNull(enumeration) then do while (enumeration.hasMoreElements) typeDescription = enumeration.nextTypeDescription MsgBox typeDescription.name loop endif endif End Sub - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [dev] OLE, Source code generation and reflection ... the boring story ...
What a nonsense ... the BASIC program is the following and I think, that it does pretty much the same as done in climaker REM * BASIC * Sub Main MyReflectionTest End Sub Sub MyReflectionTest Dim oTypeDescriptionProvider as Object Dim enumeration as Object Dim typeDescription as object dim valueArray(0) dim level valueArray(0) = com.sun.star.uno.TypeClass.SERVICE oTypeDescriptionProvider = CreateUnoService( com.sun.star.reflection.TypeDescriptionProvider ) if not IsNull(oTypeDescriptionProvider) then enumeration = oTypeDescriptionProvider.createTypeDescriptionEnumeration(, valueArray, -1) if not isNull(enumeration) then do while (enumeration.hasMoreElements) typeDescription = enumeration.nextTypeDescription MsgBox typeDescription.dbg_methods loop endif endif End Sub - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [dev] OLE, Source code generation and reflection ... the boring story ...
if you want to programmatically determine all types, you could use the com.sun.star.comp.stoc.RegistryTypeDescriptionProvider service. For example the climaker uses it to create all cli types from UNO types. Have a look at cli_ure/source/climaker/climaker_app.cxx. Eventually com.sun.star.reflection.XTypeDescriptionEnumeration.nextTypeDescription() is used to iterate over all available types. Yes, I tried that - but all I get are empty enumerations ... as an example an OOBASIC code trying to get all services from the reflection module ... REM Smalltalk Source code example REM typeCollection := OrderedCollection new. REMtypeCollection add: OOCSSUnoTypeClass::SERVICE. REMenumeration := anInstance REMcreateTypeDescriptionEnumeration: 'com.sun.star.reflection' REMtypes: (OSVariantarg fromIntegerCollection: typeCollection) REMdepth: OOCSSReflectionTypeDescriptionSearchDepth::INFINITE . REMaCollection := OrderedCollection new. REM[ enumeration hasMoreElements ] whileTrue:[ REMaCollection add: enumeration nextTypeDescription REM]. REMaCollection Sub MyReflectionTest Dim oTypeDescriptionProvider as Object Dim enumeration as Object Dim typeDescription as object dim valueArray(0) valueArray(0) = com.sun.star.uno.TypeClass.SERVICE oTypeDescriptionProvider = CreateUnoService( com.sun.star.reflection.XTypeDescriptionEnumeration ) if not IsNull(oTypeDescriptionProvider) then enumeration = oTypeDescriptionProvider.createTypeDescriptionEnumeration(com.sun.star.reflection, valueArray, -1) if not isNull(enumeration) then do while (enumeration.hasMoreElements) typeDescription = enumeration.nextTypeDescription MsgBox typeDescription.dbg_methods loop endif endif End Sub Marten - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[dev] OLE, Source code generation and reflection ... the boring story ...
I'm still on a rather boring project here (actually I worked for this last year also but stopped that working and now I'm looking at that problem again) ... I try to connect VASmalltalk to OpenOffice via OLE. My approach was to get all the information from OpenOffice via reflection and then I try to produce Smalltalk code, which can be pretty nice used to do OpenOffice programming at least under Windows using OLE. One of my first problems to get a list of all services, constants, enum etc ... there is simply no way to get this via software control. Therefore I installed the SDK and parsed all files below the directory classes and I got a list with more than 3000 items - fine. Via this method and some reflection I get around 176 definitions for enums, constants and so on. Then I tried to get information about services and interfaces, but this sometimes has success (e.g 'com.sun.star.chart2.Title'), but sometimes not a single information can be retrieved (e.g. ''com.sun.star.chart2.DataPoint''). In the later case I always get VtUnknown error from the OLE subsystem. My attempts to get more meta information is either via the core reflection service or via an instance via beans.introspection but both classes can not deliver valid informations on most interfaces and services. Any idea how what the problem can be Marten - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [dev] UNO, URP, IIOP, etc.
It would be pretty interesting to see your discussion in the public, because I tried to write a language wrapper for Smalltalk in the past (but only via OLE) and I did not finished it. Therefore I'm really interested in this area. Marten - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [dev] 2.0.4 : Help-About shows 2.0.3
Werner Schulte schrieb: Hello all. Downloaded and installed 2.0.4 this morning (Windows and Linux) and found Help-About shows 2.0.3 Opening the dialog via HilfeInfo über OpenOffice.org shows me: OpenOffice.org 2.0.4 Marten - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [dev] How to get ALL interfaces, ALL services, ALL enums, ALL ...
Marten Feldtmann schrieb: Is there any support to get ALL available definitions within OpenOffice: * all interfaces * all enums * all structs * all services Well, the answer was simple: install the SDK ( I had this already) and find all files ending up with idl and then let code generator fly over these names, do reflection and the results are around 1600 classes I still can not get the definitions (name/Value) of the constants :-( Marten - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [dev] OLE Access to structure components ... how ??
Marten Feldtmann schrieb: As an example here is my Smalltalk method for getting aName. ^self invoke: 'aName' name of the method I have to invoke withArguments: Array newno arguments returnType: trueyes I want to have the return values I've found the answer for myself: in this case this is not a method invoke, but a property invoke and then one gets the values of a struct. Marten - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[dev] How to get ALL interfaces, ALL services, ALL enums, ALL ...
Is there any support to get ALL available definitions within OpenOffice: * all interfaces * all enums * all structs * all services Marten - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[dev] OLE Access to structure components ... how ??
I again try to connect Smalltalk (IBM VisualAge Smalltalk) to OpenOffice and I start doing this via OLE/COM. I'm actually not that good in OLE, but I managed to query interfaces for their methods and properties and this works quite well - from these informations I would like to create source code compiled into Smalltalk. To build the method signatures I came across structures and nwo I'm lost ... One of these structures I have is com.sun.star.reflection.ParamInfo and I try to get the values of the components aName, aMode and aType. As an example here is my Smalltalk method for getting aName. ^self invoke: 'aName' name of the method I have to invoke withArguments: Array newno arguments returnType: trueyes I want to have the return values I would assume to get a String - but whatever I do: I get a low level error DISP_E_MEMBERNOTFOUND. It even finds a dispid for the method above (I think it was the 3), but calling it simply fails and returns this error. Any idea ??? Marten - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]