View Issue Details

IDProjectCategoryView StatusLast Update
0003518JEDI VCL00 JVCL Componentspublic2006-04-05 01:19
ReporterfikretAssigned Toobones 
Status resolvedResolutionfixed 
Product Version3.10 
Target VersionFixed in Version3.30 
Summary0003518: TJvDBDateTimePicker crashes BDS 2006
DescriptionJust drop TJvDBDateTimePicker on form, and try to leave form, your
mouse cannot leave that region, and you cannot do anything. If you use
ALT-TAB, you can change active app, but your mouse will stay in that
region. It will give many error messages, and BDS2006 will crash.
Additional InformationI have reproduced this error on 3 computers,
with released JVCL3 and with CVS version.
TagsNo tags attached.


has duplicate 0003626 resolvedobones JvDBDatePicker Exception: Read of address 00000000 At DesignTime 



2006-03-14 08:14

reporter   ~0008664

This is caused by the WMPaint method in TJvDateTimePicker. There is no checking done to see if the datalink is setup before using it. I have added the following (Rough) code which has cured the problem for me.

procedure TJvDBDateTimePicker.WMPaint(var Msg: TWMPaint);
  D: TDateTime;
  ST: TSystemTime;
  if not (csPaintCopy in ControlState) then
    d := 0 ; //###Add this line###
    if assigned(FDatalink) then //###Add this line###
    try //###Add this line###
      if Kind = dtkDate then
        if IsDateAndTimeField then
          D := FDataLink.Field.AsDateTime
          D := Trunc(FDataLink.Field.AsDateTime);
        if IsDateAndTimeField then
          D := FDataLink.Field.AsDateTime
          D := Frac(FDataLink.Field.AsDateTime);
    except //###Add this line###
      D := 0 ; //###Add this line###
    end; //###Add this line###

    DateTimeToSystemTime(D, ST);
    DateTime_SetSystemTime(FPaintControl.Handle, GDT_VALID, ST);
    SendMessage(FPaintControl.Handle, WM_ERASEBKGND, Msg.DC, 0);
    SendMessage(FPaintControl.Handle, WM_PAINT, Msg.DC, 0);


2006-03-16 11:14

administrator   ~0008675

The try except is not acceptable, but thanks for tracking it down to WM_PAINT. I'll assess that a little later on.


2006-03-31 00:24

administrator   ~0008778

Well, that's what I thought. FDataLink is created in the constructor, but it's FDataLink.Field that can be nil. Testing for it and setting D to Now (default value for Date Edits) solves this.
It will be put in CVS as soon as it is fixed as SourceForge:


2006-04-05 01:19

administrator   ~0008929

This is now in CVS

Issue History

Date Modified Username Field Change
2006-02-17 02:04 fikret New Issue
2006-03-14 08:14 willhonor Note Added: 0008664
2006-03-16 11:14 obones Note Added: 0008675
2006-03-16 11:14 obones Status new => confirmed
2006-03-31 00:24 obones Note Added: 0008778
2006-04-05 01:19 obones Status confirmed => resolved
2006-04-05 01:19 obones Resolution open => fixed
2006-04-05 01:19 obones Assigned To => obones
2006-04-05 01:19 obones Note Added: 0008929
2006-04-06 09:04 obones Relationship added has duplicate 0003626