Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

"Failed to set calendar date or time" - Windows XP and Delphi 5

920 views
Skip to first unread message

David J Taylor

unread,
Nov 30, 2006, 5:31:59 PM11/30/06
to
[Posted in .rtl.win32 but no reply]

A fairly innocuous, although new application, written with Delphi 5 fails
to initialise under Windows XP with the error message:

"Failed to set calendar date or time"

It seems to be something to do with setting the date on a TDateTimePicker
component, but I've used those before without any problems. Two reports
have said: "If you set the Windows 2000 compatibility mode for the program
(running under XP) it works OK"!

As far as I know I'm doing nothing out of the ordinary, the
TDateTimePicker (in date mode) just sits on the form. The application
doesn't even initialise, so I guess the Main Form Create is failing, at
that point.

Any ideas?

(I checked Google but only found a couple of references in Russian which I
couldn't translate).

Thanks,
David


Liz

unread,
Dec 1, 2006, 12:46:43 AM12/1/06
to
David J Taylor wrote:

> Any ideas?

Date/time format issue?

--
Liz the Brit
Delphi things I have released: http://www.xcalibur.co.uk/DelphiThings

David J Taylor

unread,
Dec 1, 2006, 4:56:39 AM12/1/06
to
Liz wrote:
> David J Taylor wrote:
>
>> Any ideas?
>
> Date/time format issue?

Yes, that's what I thought, but I do nothing to override the standard
date/time format in my application, and I made no change to the default
control in that area - only the anchors and the OnChange event differ:

-----------------------------------------
default:
object DateTimePicker1: TDateTimePicker
Left = 200
Top = 528
Width = 129
Height = 25
CalAlignment = dtaLeft
Date = 39052.4053120718
Time = 39052.4053120718
DateFormat = dfShort
DateMode = dmComboBox
Kind = dtkDate
ParseInput = False
TabOrder = 2
end

-----------------------------------------
mine:
object DateTimePickerGlobalUTC: TDateTimePicker
Left = 16
Top = 528
Width = 121
Height = 25
Anchors = [akLeft, akBottom]
CalAlignment = dtaLeft
Date = 38749.0416666667
Time = 38749.0416666667
DateFormat = dfShort
DateMode = dmComboBox
Kind = dtkDate
ParseInput = False
TabOrder = 0
OnChange = DateTimePickerGlobalUTCChange
end
-----------------------------------------


Perhaps the OnChange event is getting called during the Create events?
I'll add a boolean which isn't set until after the FormShow event to make
the OnChange event do nothing.....

Cheers,
David


Liz

unread,
Dec 1, 2006, 6:38:00 AM12/1/06
to
David J Taylor wrote:


> Perhaps the OnChange event is getting called during the Create
> events? I'll add a boolean which isn't set until after the FormShow
> event to make the OnChange event do nothing.....

If you call showmodal chances are yes, I saw exactly the same thing,
what I did was put the assignment to the onchange at the end of my
create/show procedure as necessary

David J Taylor

unread,
Dec 1, 2006, 9:50:11 AM12/1/06
to
Liz wrote:
> David J Taylor wrote:
>
>
>> Perhaps the OnChange event is getting called during the Create
>> events? I'll add a boolean which isn't set until after the FormShow
>> event to make the OnChange event do nothing.....
>
> If you call showmodal chances are yes, I saw exactly the same thing,
> what I did was put the assignment to the onchange at the end of my
> create/show procedure as necessary

No, it's a main form, and it's not called with ShowModal. However, adding
the flag so that the OnChange event is only active once the FormShow event
is running seems to have cured the problem on at least one PC. Maybe the
XP Theme Manager was getting in a little too early....

Thanks,
David


Liz

unread,
Dec 1, 2006, 9:41:43 AM12/1/06
to
David J Taylor wrote:


> No, it's a main form, and it's not called with ShowModal. However,
> adding the flag so that the OnChange event is only active once the
> FormShow event is running seems to have cured the problem on at least
> one PC. Maybe the XP Theme Manager was getting in a little too
> early....

I had issues when moving to 2006 for the same reason it would call the
onchange before I expected it to.

David J Taylor

unread,
Dec 8, 2006, 6:12:48 AM12/8/06
to
Liz wrote:
> David J Taylor wrote:
>
>
>> No, it's a main form, and it's not called with ShowModal. However,
>> adding the flag so that the OnChange event is only active once the
>> FormShow event is running seems to have cured the problem on at least
>> one PC. Maybe the XP Theme Manager was getting in a little too
>> early....
>
> I had issues when moving to 2006 for the same reason it would call the
> onchange before I expected it to.

This seems to be tied in with a software protection scheme, so I'm
dropping it here. Thanks to those who helped.

Cheers,
David


Siwakorn Apichitsopa

unread,
Apr 26, 2017, 6:24:45 AM4/26/17
to
เมื่อ วันศุกร์ที่ 1 ธันวาคม ค.ศ. 2006 5 นาฬิกา 31 นาที 59 วินาที UTC+7, David J Taylor เขียนว่า:
Because you use wrong parameter seq. so yy,mm,dd
0 new messages