delphi - Access violation with TDictionary.Add -
Does anybody know why I'm getting an access violation with the following : < / P>
unit TestForm; Interface Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Generics.Collections, Vcl.Grids, using Vcl.ValEdit Does; Type TClientThing = class private iCDic: TDictionary & lt; String, string & gt; Published property Dic: TDictionary & lt; String, string & gt; ICDic Write iCDic; End; TForm1 = Class (TForm) vleHeader: TValueListEditor; Process formulas (sender: toobject); Private {Private Announcements} Clienting: TClientThing; Public {public declaration} end; Var Form 1: Teform 1; Implementation {$ R * .dfm} Process TForm1.FormCreate (Sender: Toubys); Var vCustomParamKey: string; VCustomValueKey: string; J: integer; Edited Begin // config directory to start with ClientThing Get header parameter J ...: = 0 vleHeader.RowCount to - 1 vCustomParamKey be started: = vleHeader.Cells [0, j]; VCustomValueKey: vleHeader.Cells [1, J]; Dic.Add (vCustomParamKey, vCustomValueKey); End; End; End; End.
Access violation is on the DIC.Add line. The exception is:
with me are all night has ended and possibly probably missed some TValueListEditor material (code editor view):
X application = g9V0rB9a3J5UF8 X authentication = kQNvuuimr0yMtEYZtXAZntTScPlvjecEAGtvbnNIU = JSONRpc = 2.0
Form ClientThing does not specify a value for
, so it There is also zero
. Assign this to a value, and then assign a value to iCDic
You should have been able to detect this problem when you stepped into the code with the debugger.
Comments
Post a Comment