Project JEDI - Issue Tracker
Mantis Bugtracker

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0003518 [JEDI VCL] 00 JVCL Components crash always 2006-02-17 02:04 2006-04-05 01:19
Reporter fikret View Status public  
Assigned To obones
Priority normal Resolution fixed  
Status resolved   Product Version 3.10
Summary 0003518: TJvDBDateTimePicker crashes BDS 2006
Description Just 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 Information I have reproduced this error on 3 computers,
with released JVCL3 and with CVS version.
Tags No tags attached.
Attached Files

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

-  Notes
willhonor (reporter)
2006-03-14 08:14

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);
obones (administrator)
2006-03-16 11:14

The try except is not acceptable, but thanks for tracking it down to WM_PAINT. I'll assess that a little later on.
obones (administrator)
2006-03-31 00:24

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: [^]
obones (administrator)
2006-04-05 01:19

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

Mantis 1.1.6[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker