저는 Delphi 2010의 프랑스 사용자이므로 제 영어 실력을 실례하겠습니다.사용자 정의 속성 흐름 읽기 오류
TCustomControl에서 컨트롤을 만들었습니다. 이 컨트롤에는 TCollectionItem 하위 항목으로 채워진 TOwnedCollection이 있습니다. 해당 항목에는 게시 된 사용자 지정 목록 속성이 있습니다. 이 목록은 나를 만든 정수 쌍의 목록입니다. 이 속성에 대한 맞춤 제작 편집기를 작성했으며 완벽하게 작동합니다. 이제 dfm에 목록 데이터를 쓰고 싶습니다. 조금 더 어려워집니다. 여기
내가 무슨 짓을했는지 있습니다 :
TPedroGraphLineCollectionIem = class(TCollectionItem)
published
property PointList: TPedroIntegerCoupleList read FList write SetList
stored GetStored;
...
procedure TPedroGraphLineCollectionIem.DefineProperties(Filer: TFiler);
begin
inherited;
//'PointList' : the property name
//FList.Count > 0 : Is the list empty ?
Filer.DefineProperty('PointList', ReadListData, WriteListData,
(FList.Count > 0));
end;
...
procedure TPedroGraphLineCollectionIem.ReadListData(Reader: TReader);
var
Val1, Val2: Integer;
begin
with Reader do
begin
ReadListBegin;
while not EndOfList do
begin
Val1 := ReadInteger;
Val2 := ReadInteger;
FList.AddCouple(Val1, Val2);
end;
ReadListEnd;
end;
end;
...
procedure TPedroGraphLineCollectionIem.WriteListData(Writer: TWriter);
var
I: Integer;
begin
with Writer do
begin
WriteListBegin;
for I := 0 to Count - 1 do
begin
WriteInteger(FList[I].Value1);
WriteInteger(FList[I].Value2);
end;
WriteListEnd;
end;
end;
WriteListData 절차는 완벽하게 작동하고, DFM에 값을 기록합니다. 그러나 폼을로드하려고하면 항상 충돌이 발생하고이 속성에 읽기 흐름 오류가 있음을 알리는 대화 상자가 표시됩니다.
FList는 클래스 생성자 내에 만들어집니다.
object MainFrm: TMainFrm
Left = 0
Top = 0
Caption = 'MainFrm'
ClientHeight = 425
ClientWidth = 689
Color = clBtnFace
ParentFont = True
OldCreateOrder = False
Position = poScreenCenter
OnCreate = FormCreate
OnDestroy = FormDestroy
PixelsPerInch = 96
TextHeight = 13
object PedroGraph1: TPedroGraph
Left = 120
Top = 136
Width = 313
Height = 209
TitleFont.Charset = DEFAULT_CHARSET
TitleFont.Color = clWindowText
TitleFont.Height = -11
TitleFont.Name = 'Tahoma'
TitleFont.Style = []
Lines = <
item
LinePen.Color = clRed
PointList = (
1
2
3
4)
end>
MarksFont.Charset = DEFAULT_CHARSET
MarksFont.Color = clWindowText
MarksFont.Height = -11
MarksFont.Name = 'Tahoma'
MarksFont.Style = []
end
end
오류 메시지 (프랑스어) :
1
Erreur lors de la lecture de TPedroGraphLineCollectionItem.PointList: Valeur de propriété incorrecte. Ignorer l'erreur et continuer ?Remarque: ceci peut provoquer la suppression de composants ou la perte de valeurs de propriété
2
Erreur lors 드 라 강의 드 TPedroGraphLineCollectionItem 여기
는 .DFM이고 . □□ : 라 소유주 □□ n'exist e pas. Ignorer 난 erreur 등 continuer Remarque : 세시 peut provoquer 라 억제 드 COMPOSANTS 라 perte 드 VALEURS 드 PROPRIETE
주 ou는 다음 '□'문자 정말이 표시됩니다.
3
Erreur lors 드 라 강의 드 TPedroGraphLineCollectionItem □□
4
Erreur lors 드 라 강의 드 PedroGraphLines1.Lines :. Valeur 드 PROPRIETE incorrecte. Ignorer 난 erreur 등 continuer Remarque : 세시 peut provoquer 라 진압 드 COMPOSANTS ou는 라 perte 드 VALEURS 드 PROPRIETE
5
Erreur 단품 생성 드 라 FICHE : Erreur 드 뒤 플럭스 강의. TPedroIntegerCoupleList의
선언 :
TPedroIntegerCouple = record
Value1: Integer;
Value2: Integer;
end;
TPedroGenericList<T> = class(TList<T>)
private
FOnChange: TNotifyEvent;
FUpdating: Boolean;
protected
procedure Notify(const Item: T; Action: TCollectionNotification); override;
procedure DoChange;
published
public
constructor Create;
procedure SortCustom; virtual; abstract;
procedure Assign(const Source: TPedroGenericList<T>);
property OnChange: TNotifyEvent read FOnChange write FOnChange;
end;
TPedroIntegerCoupleList = class(TPedroGenericList<TPedroIntegerCouple>)
private
function GetString: String;
procedure SetString(const Value: String);
public
procedure SortCustom; override;
function AddCouple(const Value1, Value2: Integer): Integer;
procedure InsertCouple(const Index, Value1, Value2: Integer);
property AsString: String read GetString write SetString;
end;
어디에서 잘못입니까?
이동 프로젝트 옵션과 같은 비 충돌하는 이름을 만들기 위해 노력하고있다 "사용 디버그 DCU의"체크 상자, 다음'TPedroGraphLineCollectionIem.ReadListData'에서와'TPedroGraphLineCollectionIem에 중단 점을 넣어. DefineProperties'를 실행하고 DFM 로딩 프로세스를 정확히 디버깅하십시오. 그런 다음 다시 돌아와서 어떤 줄이 정확하게 오류를 일으키는 지 말하십시오. (텍스트로 예외 대화 상자에서 복사하여 붙여 넣기 만 가능) –
나는 이것을 시도했지만 아무 것도 변경되지 않았습니다. 폼을로드하는 것에 대해 이야기 할 때는 EDI를 의미하며 중단 점은 사용되지 않습니다. – Pedrault
당신은 하나의 IDE를 다른 컴퓨터에서 실행하여 구성 요소를 디버깅 할 수 있습니다 - "호스트 응용 프로그램"(IDE의 다른 사본)을 사용하여 디버깅 DLL과 BPL (그리고 구성 요소는 BPL)에 대해 읽습니다. // 또한 예외 텍스트의 사본도 어쨌든 사용됩니다 질문의 적절한 부분이 될 수도 있고 DFM 소스가 될 수도 있습니다. 단지 프로그램을 컴파일하고 실행하고 디버깅하기 위해 IDE에서 폼을 열 필요가 없습니다. 양식을 열지 않고 디버깅하십시오. –