This forum is temporaily read-only. All existing discussions remain available for reference. For new questions, bug reports or support requests, please contact us at mail@lmdsupport.com.

LMD Design Pack

Hello,
  I wonder about better documentation or some samples, how use TLMDPropertyInspector class and dynamic properties. I see some events
-OnDynPropsDefine
-OnDynPropGetValue
-OnDynPropSetValue
I try use OnDynPropsDefine and OnDynPropGetValue events

procedure OnDynPropsDefine(...);
begin
ADefiner.DefineProperty( 'AAA', tkString, true, false);
end;

procedure OnDynPropGetValue(Sender: TObject;
  AInstance: TPersistent; AProperty: ILMDProperty; AUserData: Pointer;
  AResult: TLMDPropertyInspectorDynValue);
begin
  if Aproperty.Name = 'AAA' then
    AResult.AsStrVal := 'Value'; //Here is critical place
end;

It is look like good and simple, but I very often get error:
"Project XXX raised exception class EpropertyConvertorError with message 'Invalid Property Type'."

I can get this error always, when I try modify Ancors property in component, which has dynamic AAA property.

Thank you for cooperation
Daril

Comments

  • Hi,

    In DefineProperty you should use TypeInfo(string), not tkString (it even should not compile).

    Eugene,
    LMD Innovative.
Sign In or Register to comment.