[DUG] Dynamically accessing a Classes methods and sometimes returning results

Robert Martin rob at chreos.co.nz
Tue Apr 24 14:10:04 NZST 2012


Hi

We have a COM automation class that works fine for access via COM.  I 
created an HTTP server built into our app that provides services by Http 
requests.  What I would like to do is extend it to also dynamically 
support any COM call supported by our COM class  (not by using a massive 
if statement that needs to be manually updated).

I see that I can run a classes method using methodAddress(methodname : 
string) and assigning the result to a method pointer, which is great 
except I then need to define a method pointer for each type of method 
being called ( procedure a, procedure a(a : string). procedure a(a : 
Integer) etc).  This kind of defeats the purpose as I then need to have 
a large if that maps the method call string to the method signature.

I note that my COM class Inherits from  TAutoObject which should give me 
easy access to methods but Im not sure how.  All the COM stuff seems to 
be hidden under the hood and I haven't been able to find code examples.

Any suggestions ?

Thanks
Rob



More information about the Delphi mailing list