Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » swt.ole.win32: Variant to java.util.Date
swt.ole.win32: Variant to java.util.Date [message #449074] Mon, 17 January 2005 23:43 Go to next message
Boris Munivrana is currently offline Boris MunivranaFriend
Messages: 23
Registered: July 2009
Junior Member
Hi there,

I'm trying to wrap the Active-X Control "DatePicker" (ProgID =
MSComCtl2.DTPicker)with the swt.ole.win32 - classes and I'm wondering how
to interprete the property "Value" (IDispatch-ID 20)of said control, which
should give back a Date. Here's what I'm doing:

int[] rgdispid = automation.getIDsOfNames(new String[]{"Value"});
int dispIdMember = rgdispid[0];
Variant result = automation.getProperty(dispIdMember);

Calling e.g. the result.getString() or result.getInt() for the Date
2005-01-18 creates "38370"

Does anybody know a way to convert the result into a java.util.Date?

Cheers,

Boris
Re: swt.ole.win32: Variant to java.util.Date [message #449149 is a reply to message #449074] Tue, 18 January 2005 19:28 Go to previous message
Veronika Irvine is currently offline Veronika IrvineFriend
Messages: 1272
Registered: July 2009
Senior Member
There is some info about this out there:

http://blogs.msdn.com/ericlippert/archive/2003/09/16/53013.a spx

From the look sof teh above link, it can be quite messy. I think the
correct way is to use the built MSDN calls like VarBstrFromDate.

http://msdn.microsoft.com/library/default.asp?url=/library/e n-us/automat/htm/chap7_1yzp.asp

This is not currently supported by SWT - you could enter a bug report and
request the feature

"Boris Munivrana" <bmunivrana@web.de> wrote in message
news:cshiiq$bip$1@www.eclipse.org...
> Hi there,
>
> I'm trying to wrap the Active-X Control "DatePicker" (ProgID =
> MSComCtl2.DTPicker)with the swt.ole.win32 - classes and I'm wondering how
> to interprete the property "Value" (IDispatch-ID 20)of said control, which
> should give back a Date. Here's what I'm doing:
>
> int[] rgdispid = automation.getIDsOfNames(new String[]{"Value"});
> int dispIdMember = rgdispid[0];
> Variant result = automation.getProperty(dispIdMember);
>
> Calling e.g. the result.getString() or result.getInt() for the Date
> 2005-01-18 creates "38370"
>
> Does anybody know a way to convert the result into a java.util.Date?
>
> Cheers,
>
> Boris
>
>
>
Previous Topic:Double clicking in a Text and word boundaries on linux
Next Topic:Question about error "SWT Error: No more handles"
Goto Forum:
  


Current Time: Fri Apr 26 19:40:32 GMT 2024

Powered by FUDForum. Page generated in 0.03377 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top