View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0002385 | JEDI VCL | 00 JVCL Components | public | 2004-12-15 03:33 | 2004-12-26 22:32 |
Reporter | borzov | Assigned To | |||
Priority | normal | Severity | crash | Reproducibility | always |
Status | resolved | Resolution | open | ||
Product Version | 3.00 BETA 2 | ||||
Target Version | Fixed in Version | ||||
Summary | 0002385: Access Violation in procedure TJvBrowseForFolderDialog.UpdateStatusText(AText: string); | ||||
Description | I found in procedure TJvBrowseForFolderDialog.UpdateStatusText(AText: string) (unit JvBrowseForder) this text: AText := MinimizeFileName(AText, Application.MainForm.Canvas, (WindowRect.Right - WindowRect.Left) - (ItemRect.Left - WindowRect.Left) * 2 - 8); In my Application this procedure runs before initialization of MainForm, and so Application.MainForm is not assigned and I get Access Violation. | ||||
Tags | No tags attached. | ||||
|
Try changing the procedure to: procedure TJvBrowseForFolderDialog.UpdateStatusText(AText: string); const cStatusLabel = $3743; var WindowRect, ItemRect: TRect; ItemHandle: THandle; ACanvas:TCanvas; begin if [odStatusAvailable, odNewDialogStyle] * FUsedOptions <> [odStatusAvailable] then Exit; if StatusText <> '' then AText := StatusText else begin ItemHandle := GetDlgItem(FDialogWindow, cStatusLabel); if ItemHandle <> 0 then begin GetWindowRect(FDialogWindow, WindowRect); GetWindowRect(ItemHandle, ItemRect); if Application.MainForm <> nil then ACanvas := Application.MainForm.Canvas else begin ACanvas := TCanvas.Create; ACanvas.Handle := GetDC(0); end; AText := MinimizeFileName(AText, ACanvas, (WindowRect.Right - WindowRect.Left) - (ItemRect.Left - WindowRect.Left) * 2 - 8); if Application.MainForm = nil then ACanvas.Free; end; end; SetStatusText(AText); end; Also, add Graphics to the uses clause |
|
This has obviously been fixed in CVS. |
Date Modified | Username | Field | Change |
---|---|---|---|
2004-12-15 03:33 | borzov | New Issue | |
2004-12-15 11:14 |
|
Note Added: 0005891 | |
2004-12-15 11:14 |
|
Status | new => feedback |
2004-12-26 22:32 | robert_marquardt | Note Added: 0006017 | |
2004-12-26 22:32 | robert_marquardt | Status | feedback => resolved |