mrbar2000 wrote:
> IOrder = iinterface
> [{GUID}]
> function CalculateTax(Param1: IInfraString; Param2: IInfraInteger):
> IInfraFloat;
> end;
>
>
> TOrder = class(TInfraObject, IOrder)
> protected
> function CalculateTax(Param1: IInfraString; Param2: IInfraInteger):
> IInfraFloat;
> end;
>
> then this method is registred on manager like:
>
> TypeRegisterService.RegisterMethod(IOrder, 'CalculateTax',
> @CalculateTax);
>
> We need a function able to call this protected method like:
>
> Params.Clear;
> Params.Add(TInfraString.NewFrom('Test'));
> Params.Add(TInfraInteger.NewFrom(125));
> Result := CallMethod(SomeOrderInstance, 'CalculateTax', Params);
Order := SomeOrderInstance as IOrder;
Tax := Order.CalculateTax(TInfraString.NewFrow('Test'),
TInfraInteger.NewFrom(125));
> We know that need to use ASM but we don't know how to do! We need help
> for this.
Which version of Delphi do you use? I think it's version 7 that
introduced RTTI for interface types. You can call a method indirectly
using that. It was introduced primarily for implementing SOAP. Have your
interface descend from IInvokable.
On the other hand, you could also go the route of COM's IDispatch
interface. It lets you look up a method index by name and then call that
method by its index.
--
Rob
------------------------ Yahoo! Groups Sponsor --------------------~-->
Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life.
http://us.click.yahoo.com/KIlPFB/vlQLAA/TtwFAA/i7folB/TM
--------------------------------------------------------------------~->
-----------------------------------------------------
Home page: http://groups.yahoo.com/group/delphi-en/
To unsubscribe: [EMAIL PROTECTED]
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/delphi-en/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/