Board index » delphi » Delphi 4, how to use late binding with property Set/Get and Method calls?

Delphi 4, how to use late binding with property Set/Get and Method calls?

Hi everyone,

my Delphi progrm is an OLE Automation Client (i.e for AutoCAD, Visio,
WinWord). The program needs to access Properties of the Automatino Server
and needs to call methods.
The Properties and Methods are not known at compile time! Therefore I need
to use late binding.
Example:
the user can determine which Property to get or set or which method to call.

The invoke API call seems to be the right one for the task. Has anyone got
an example on how to use late binding the way I need to use it?

Thanks

 

Re:Delphi 4, how to use late binding with property Set/Get and Method calls?


Sascha Krning a crit dans le message <7mfaop$2...@forums.borland.com>...

Quote
>Hi everyone,

>my Delphi progrm is an OLE Automation Client (i.e for AutoCAD, Visio,
>WinWord). The program needs to access Properties of the Automatino Server
>and needs to call methods.
>The Properties and Methods are not known at compile time! Therefore I need
>to use late binding.

it's right, you got to use the fonctionnalities of IDispatch.
Get a IDispatch on your object , then use the methods GetIdsOfNames (which
returns an array of all the entry point of the "real" interface) and Invoke
(to call one of the entry point).

Re:Delphi 4, how to use late binding with property Set/Get and Method calls?


Tony Tanzillo has good examples of AutoCAD/Delphi.  Don't know the
URL, but google search "Tony Tanzillo".

Quote
Sascha Krning wrote in message <7mfaop$2...@forums.borland.com>...
>Hi everyone,

>my Delphi progrm is an OLE Automation Client (i.e for AutoCAD, Visio,
>WinWord). The program needs to access Properties of the Automatino Server
>and needs to call methods.
>The Properties and Methods are not known at compile time! Therefore I need
>to use late binding.
>Example:
>the user can determine which Property to get or set or which method to
call.

>The invoke API call seems to be the right one for the task. Has anyone got
>an example on how to use late binding the way I need to use it?

>Thanks

Re:Delphi 4, how to use late binding with property Set/Get and Method calls?


Just use OleVariants and it works with late binding.

Quote
Dominique JOCAL <djo...@aston.fr> wrote in message

news:7mfe5h$2116@forums.borland.com...
Quote

> Sascha Krning a crit dans le message <7mfaop$2...@forums.borland.com>...
> >Hi everyone,

> >my Delphi progrm is an OLE Automation Client (i.e for AutoCAD, Visio,
> >WinWord). The program needs to access Properties of the Automatino Server
> >and needs to call methods.
> >The Properties and Methods are not known at compile time! Therefore I
need
> >to use late binding.

> it's right, you got to use the fonctionnalities of IDispatch.
> Get a IDispatch on your object , then use the methods GetIdsOfNames (which
> returns an array of all the entry point of the "real" interface) and
Invoke
> (to call one of the entry point).

Other Threads