<div dir="ltr">What version of TNT are you using ?<br><br>There is nothing intrinsically wrong with the line on which the error is occurring, which suggests that the problem is with the parameters involved.  Given that it is a write op to a NIL address, this points the finger at the destination of the WStrLCopy()... the pszText member of the item data.<div><br><div>There is potential for the pszText parameter to be invalid, if the LVIF_TEXT flag is not set in the notification mask.  According to the community additions on the MSDN ref for the LVN_DISPINFO notification (<a href="http://msdn.microsoft.com/en-us/library/windows/desktop/bb774818(v=vs.85).aspx">http://msdn.microsoft.com/en-us/library/windows/desktop/bb774818(v=vs.85).aspx</a>), this is specifically the case on Windows 8 when list selection changes, as would occur when keying up/down through the list, for example.<br><br>So far, everything seems to point in the same direction....<br><br><br>However, the code you have quoted above is conditional on the LVIF_TEXT flag being set, but there is code that precedes this in TNT which invokes the inherited implementation of the CNNotify handler, removing and re-instating the LVIF_TEXT flag in the process.<br><br>The reason I ask about the version you are using is that in the version I am looking at (2.3.0) this preceding code appears to handle the LVIF_TEXT flag correctly, only re-applying the LVIF_TEXT flag if it was originally set.  But I wonder if you have some version of the TNT code which perhaps contains a flaw in this area and is adding this flag when it shouldn&#39;t ?<br><br>Or is it possible that your copy of the source has been modified from the TNT original in a way that might have introduced such a flaw ?<br><br><br>It might be helpful to post the entire LVN_GETDISPINFOW handler from the CNNotify() method, to be sure.</div></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On 3 November 2014 20:06, Ross Levis <span dir="ltr">&lt;<a href="mailto:ross@stationplaylist.com" target="_blank">ross@stationplaylist.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div lang="EN-NZ" link="blue" vlink="purple"><div><p class="MsoNormal"><span style="font-size:12.0pt;color:#1f497d">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.<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:12.0pt;color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:12.0pt;color:#1f497d">It is a virtual listview using OnData.  Here is a portion of a MadExcept log.  Can provide more if required.<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:12.0pt;color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:10.0pt">exception message : Access violation at address 0050DA73 in module &#39;SPLStudio.exe&#39;. Write of address 00000000.<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:10.0pt"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:10.0pt">main thread ($d88):<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:10.0pt">0050da73 SPLStudio.exe TntWideStrUtils   180  +10 WStrLCopy<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:10.0pt">0053e20e SPLStudio.exe TntComCtrls      2104  +46 TTntCustomListView.CNNotify<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:10.0pt">004f304f SPLStudio.exe Controls         4645  +53 TControl.WndProc<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:10.0pt">004f6d5e SPLStudio.exe Controls         6342  +33 TWinControl.WndProc<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:10.0pt">004c04a5 SPLStudio.exe ComCtrls        14815  +12 TCustomListView.WndProc<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:10.0pt">0053dee4 SPLStudio.exe TntComCtrls      2023  +98 TTntCustomListView.WndProc<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:10.0pt">00539335 SPLStudio.exe TntControls       666  +19 TWinControlTrap.WindowProc<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:10.0pt">004f2d5a SPLStudio.exe Controls         4552   +5 TControl.Perform<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:10.0pt">004f6f20 SPLStudio.exe Controls         6388   +6 DoControlMsg<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:10.0pt">004f772f SPLStudio.exe Controls         6579   +1 TWinControl.WMNotify<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:10.0pt">...<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:12.0pt;color:#1f497d">Code in TntComCtrls.pas where it crashes updating a list item caption...</span><span style="font-size:10.0pt"><u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:10.0pt"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:10.0pt">      // handle any text info<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:10.0pt">      with PLVDispInfoW(NMHdr)^.item do<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:10.0pt">      begin<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:10.0pt">        if (mask and LVIF_TEXT) &lt;&gt; 0 then<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:10.0pt">        begin<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:10.0pt">          Item := GetItemW(PLVDispInfoW(NMHdr)^.item);<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:10.0pt">          if iSubItem = 0 then<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:10.0pt">&gt;&gt;&gt;&gt;&gt;  WStrLCopy(pszText, PWideChar(Item.Caption), cchTextMax - 1)<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:10.0pt">          else begin<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:10.0pt">            with Item.SubItems do begin<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:10.0pt">              if iSubItem &lt;= Count then<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:10.0pt">                WStrLCopy(pszText, PWideChar(Strings[iSubItem - 1]), cchTextMax - 1)<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:10.0pt">              else pszText[0] := #0;<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:10.0pt">            end;<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:10.0pt">          end;<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:10.0pt">        end;<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:10.0pt">      end;<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:12.0pt;color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:12.0pt;color:#1f497d">Any ideas appreciated.<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:12.0pt;color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:12.0pt;color:#1f497d">Thanks,<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:12.0pt;color:#1f497d">Ross,<u></u><u></u></span></p></div></div><br>_______________________________________________<br>
NZ Borland Developers Group - Delphi mailing list<br>
Post: <a href="mailto:delphi@listserver.123.net.nz">delphi@listserver.123.net.nz</a><br>
Admin: <a href="http://delphi.org.nz/mailman/listinfo/delphi" target="_blank">http://delphi.org.nz/mailman/listinfo/delphi</a><br>
Unsubscribe: send an email to <a href="mailto:delphi-request@listserver.123.net.nz">delphi-request@listserver.123.net.nz</a> with Subject: unsubscribe<br></blockquote></div><br></div>