Looks like "pszText" might be nil, or perhaps "with" is causing the
wrong variable to be referenced ("with" is dangerous that way).
Try changing the "if" to:
if iSubItem = 0 then
begin
assert (item <> nil);
assert (pszText <> nil);
>>>>> WStrLCopy(pszText, PWideChar(Item.Caption), cchTextMax - 1)
end
and see if the assertion fails, if so go on from there.
At 12:13 AM 11/3/2014, Ross Levis wrote:
I hope someone can help. I'm using the freeware TNT controls with D7 for a
TTntListView component. This is working fine for many users but one user
experiences a crash when simply using the keyboard to move up and down the
listview. He is using Win8 64-bit as I do here, but I can't duplicate it.
It is a virtual listview using OnData. Here is a portion of a MadExcept
log. Can provide more if required.
exception message : Access violation at address 0050DA73 in module
'SPLStudio.exe'. Write of address 00000000.
main thread ($d88):
0050da73 SPLStudio.exe TntWideStrUtils 180 +10 WStrLCopy
0053e20e SPLStudio.exe TntComCtrls 2104 +46
TTntCustomListView.CNNotify
004f304f SPLStudio.exe Controls 4645 +53 TControl.WndProc
004f6d5e SPLStudio.exe Controls 6342 +33 TWinControl.WndProc
004c04a5 SPLStudio.exe ComCtrls 14815 +12 TCustomListView.WndProc
0053dee4 SPLStudio.exe TntComCtrls 2023 +98 TTntCustomListView.WndProc
00539335 SPLStudio.exe TntControls 666 +19 TWinControlTrap.WindowProc
004f2d5a SPLStudio.exe Controls 4552 +5 TControl.Perform
004f6f20 SPLStudio.exe Controls 6388 +6 DoControlMsg
004f772f SPLStudio.exe Controls 6579 +1 TWinControl.WMNotify
...
Code in TntComCtrls.pas where it crashes updating a list item caption...
// handle any text info
with PLVDispInfoW(NMHdr)^.item do
begin
if (mask and LVIF_TEXT) <> 0 then
begin
Item := GetItemW(PLVDispInfoW(NMHdr)^.item);
if iSubItem = 0 then
>>>>> WStrLCopy(pszText, PWideChar(Item.Caption), cchTextMax - 1)
else begin
with Item.SubItems do begin
if iSubItem <= Count then
WStrLCopy(pszText, PWideChar(Strings[iSubItem - 1]),
cchTextMax - 1)
else pszText[0] := #0;
end;
end;
end;
end;
Any ideas appreciated.
Thanks,
Ross,
_______________________________________________
Delphi mailing list
[email protected]
http://lists.elists.org/cgi-bin/mailman/listinfo/delphi
_______________________________________________
Delphi mailing list
[email protected]
http://lists.elists.org/cgi-bin/mailman/listinfo/delphi