델파이 IDE에서 컴포넌트를 변환하고 자동 생성하는 패키지를 구현하고 있습니다. GExperts는 비슷한 기능을 가지고 있지만 특정 속성을 사용자 정의해야한다는 사실을 알고 있습니다. 내가 올바른 방법이다 RTTI에서 TValue를 사용 여부를 정말 확실하지 않다델파이 OpenTools API는 컴포넌트 속성을 얻습니다.
var
aVal : TValue;
aSqlS : TStrings;
begin
[...]
if (mycomp.GetComponentType = 'TADOQuery') then
if mycomp.GetPropValueByName('SQL', aVal) then
begin
aSqlS := TStrings(aVal.AsClass);
if Assigned(aSqlS) then <----- problem is here
ShowMessage(aSqlS.Text); <----- problem is here
end;
end;
:
는 지금은 TStrings를의 인스턴스 인 TADOQuery.SQL
속성을 액세스하는 방법에 붙어 가기.
IIRC, 'aVal'은'IOTAComponent' 또는 'TIComponentInterface'유형이어야합니다. 'mycomp'의 타입에 달려 있습니다. –