Summary: | [OLE][API] Support DateTime type in org.eclipse.swt.ole.win32.Variant class | ||||||
---|---|---|---|---|---|---|---|
Product: | [Eclipse Project] Platform | Reporter: | Vitaly Logvinchuk <l_v_p> | ||||
Component: | SWT | Assignee: | Platform-SWT-Inbox <platform-swt-inbox> | ||||
Status: | NEW --- | QA Contact: | |||||
Severity: | enhancement | ||||||
Priority: | P3 | CC: | jens.vagts, john.arthorne, Kevin_Haaland, mair.stefan, niraj.modi, steve_northover, veronika_irvine, vhs1998 | ||||
Version: | 3.1 | Keywords: | api, triaged | ||||
Target Milestone: | --- | ||||||
Hardware: | PC | ||||||
OS: | Windows All | ||||||
Whiteboard: | |||||||
Attachments: |
|
Description
Vitaly Logvinchuk
2005-05-31 05:15:46 EDT
Would you like to contribute your implementation of Variant to the Eclipse Open Source project? Created attachment 22125 [details]
VariantEx.java
For my project I wrote my own implementation of Variant class (see attached
VariantEx class). In this class I define additional implementation for
getting/setting data of double type; also I write additionally parts to
"getData" and "setData" methods for correct work with VT_DATE and VT_R8 types.
Are there any plans to intgreate this patch in future releases? I will look at this on Monday and try to commit the changes for 3.2 M3. Treating the date as a double has pitfalls as described in the following blog: http://blogs.msdn.com/ericlippert/archive/2003/09/16/53013.aspx In addition, this is a very confusing format for Java users because it is quite different from what is expected by other API. Microsoft provides conversion functions to and from strings. This may be a better way to go because then the OS is providing the logic of converting the value. In addition java.util.DateFormat can parse strings and provide a UTC Java Date result. In addition, there needs to be a constructor that will take a date value (possibly Variant(String date, int type) where type is VT_DATE to avoid confusion with the BSTR constructor Variant(String)). It would still be nice to have a method getDouble(). Not primarely to get VT_DATE values but VT_R8 values (e.g from excel). I'm also _realy_ interessted in VT_R8 support! Wy did you not commit the patch, it's still not in swt (3.2 M4) although you wanted to commit it for 3.2 M3 :( ... Hi, I would like to know if there is any news concerning this bug, especially about handling the double values / VT_R8 values ... I understand that concerning the date, but for getting just a double value, it is very useful, I would even say indispensable ... cheers ... (In reply to comment #5) > Treating the date as a double has pitfalls as described in the following blog: > > http://blogs.msdn.com/ericlippert/archive/2003/09/16/53013.aspx > > In addition, this is a very confusing format for Java users because it is quite > different from what is expected by other API. > > Microsoft provides conversion functions to and from strings. This may be a > better way to go because then the OS is providing the logic of converting the > value. In addition java.util.DateFormat can parse strings and provide a UTC > Java Date result. > > In addition, there needs to be a constructor that will take a date value > (possibly Variant(String date, int type) where type is VT_DATE to avoid > confusion with the BSTR constructor Variant(String)). KH, Can I have permission to add the following 4 API methods to Variant for 3.2: public Variant(double val) public Variant(long val) double Variant.getDouble() long Variant.getLong() +1 Added support for VT_I8 and VT_R8 for 3.2. *** Bug 171131 has been marked as a duplicate of this bug. *** Your bug has been moved to triage, visit http://www.eclipse.org/swt/triage.php for more info. *** Bug 437740 has been marked as a duplicate of this bug. *** |