View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0003518 | JEDI VCL | 00 JVCL Components | public | 2006-02-17 02:04 | 2006-04-05 01:19 |
Reporter | fikret | Assigned To | obones | ||
Priority | normal | Severity | crash | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Product Version | 3.10 | ||||
Target Version | Fixed in Version | 3.30 | |||
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. | ||||
|
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. Regards, Will. procedure TJvDBDateTimePicker.WMPaint(var Msg: TWMPaint); var D: TDateTime; ST: TSystemTime; begin if not (csPaintCopy in ControlState) then inherited else begin d := 0 ; //###Add this line### if assigned(FDatalink) then //###Add this line### try //###Add this line### if Kind = dtkDate then begin if IsDateAndTimeField then D := FDataLink.Field.AsDateTime else D := Trunc(FDataLink.Field.AsDateTime); end else begin if IsDateAndTimeField then D := FDataLink.Field.AsDateTime else D := Frac(FDataLink.Field.AsDateTime); end; 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); end; end; |
|
The try except is not acceptable, but thanks for tracking it down to WM_PAINT. I'll assess that a little later on. |
|
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: http://sourceforge.net/docman/display_doc.php?docid=2352&group_id=1 |
|
This is now in CVS |
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 |