remobjects / pascalscript

pascalscript
Other
447 stars 178 forks source link

Delphi 10.4 Could not call proc property type Variant #249

Open bamsey2k1 opened 3 years ago

bamsey2k1 commented 3 years ago

property like: RegisterProperty('Rec', 'Variant string', TPSPropType.iptRW);

compiled in XE7 working fine but compiled in 10.4 gives "Could not call proc"

pjrobin commented 3 years ago

Perhaps related to #232 ?

bamsey2k1 commented 3 years ago

Yeah, probably the same issue

pjrobin commented 2 years ago

found a fix: in invokeCall.inc function TPSExec.InnerfuseCall, result type variant is not implemented. adding the following code after line 188 fixed the issue:

      btVariant:
      begin
        PVariant(res.dta)^ := Invoke(Address,Args,SysCalConv,TypeInfo(Variant),False,IsConstr).AsVariant;
      end;
bamsey2k1 commented 2 years ago

Great news, it works! But you have add following code after line 67:

btVariant: Arg := TValue.From(PVariant(fvar.dta)^);