Board index » delphi » retrieve an interface from a DLL/EXE COM server

retrieve an interface from a DLL/EXE COM server

Hello,
I would like to retrieve the list of interfaces contained in an EXE or
DLL file and some informations about them such as CLSID and inheritance.
Do you know how is it possible ?

Thank you.

 

Re:retrieve an interface from a DLL/EXE COM server


Simply import the dll in the typelibrary editor.

Quote
Beno?t GRIVEL wrote:
> Hello,
> I would like to retrieve the list of interfaces contained in an EXE or
> DLL file and some informations about them such as CLSID and inheritance.
> Do you know how is it possible ?

> Thank you.

  tdk.vcf
< 1K Download

Re:retrieve an interface from a DLL/EXE COM server


Sorry I wasn't clear enough. I would like to retrieve it from my program, so I
need a delphi code  for that...

Bye

Thaddy de Koning a crit :

Quote
> Simply import the dll in the typelibrary editor.

> Beno?t GRIVEL wrote:

> > Hello,
> > I would like to retrieve the list of interfaces contained in an EXE or
> > DLL file and some informations about them such as CLSID and inheritance.
> > Do you know how is it possible ?

> > Thank you.

Re:retrieve an interface from a DLL/EXE COM server


A typelibrary is a custom resource, so you can use Tresourcestream to extract it.
Problem is, you have to decompile it, to know what it means.
The proof that it can be done is Delphi's own Typelibrary editor:It's written in
Delphi.

Quote
Beno?t GRIVEL wrote:
> Sorry I wasn't clear enough. I would like to retrieve it from my program, so I
> need a delphi code  for that...

> Bye

> Thaddy de Koning a crit :

> > Simply import the dll in the typelibrary editor.

> > Beno?t GRIVEL wrote:

> > > Hello,
> > > I would like to retrieve the list of interfaces contained in an EXE or
> > > DLL file and some informations about them such as CLSID and inheritance.
> > > Do you know how is it possible ?

> > > Thank you.

  tdk.vcf
< 1K Download

Re:retrieve an interface from a DLL/EXE COM server


Start with the function LoadTypeLib or LoadTypeLibEx.

See http://msdn.microsoft.com/library/sdkdoc/automat/chap9_6tmb.htm for more
information.

In my case, this function isn't of any use, as my ActiveX Library has no
type library, just COM objects that don't implement the IDispatch interface,
just the IUnknown interface. In this case, the DLL only contains a type
library with the CLSID of the type library itself, without information about
the contained objects.

Please let me know what information you store in the DLL (if you have used a
type library).

Quote
Beno?t GRIVEL <benoit.gri...@wanadoo.fr> wrote in message

news:377F70AF.A2294E95@wanadoo.fr...
Quote
> Hello,
> I would like to retrieve the list of interfaces contained in an EXE or
> DLL file and some informations about them such as CLSID and inheritance.
> Do you know how is it possible ?

> Thank you.

Re:retrieve an interface from a DLL/EXE COM server


Benoit -

The July edition of EXE magazine has a two-page article (by me) on how to
interrogate type libraries using Delphi. Visit www.exe.co.uk and look in
the 'Codebin' area.  There should be a very recent demo file.

Regards
Mark Smith
www.burn-{*word*221}.demon.co.uk

Other Threads