Re: Oleaut32.dll needs/doesn't need type library??



sawer <sawer@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
In Applying COM+ book:
"Dual interfaces are ordinary custom interfaces that indicate that
late binding (IDispatch) support will also be implemented by the
object. "

Well, they indicate this support by deriving from IDispatch. I've only
seen the term "custom interface" used for an interface that's neither
dual nor a dispinterface - in other words, one that has no relationship
with IDispatch. In this sense, your quote applies the term incorrectly.

Also it says:
"It seems that late binding should have absolutely nothing to do with
type libraries. Late binding is, after all, a way to remote method
calls without a type library, right? It probably surprises you, then,
to find out that the first type libraries only provided for late
binding."

I thought that "late binding" is calling Idispatch::Invoke and also
that means we have nothing to do with type libraries.

Type libraries are not only used for marshalling. Their primary goal is
to document your interface in a machine-readable way. E.g. VB IDE gives
you IntelliSense and compile-time checks when you code against an
interface it has a type library for.

You can happily describe, say, a dispinterface in a type library. It
won't help (nor hurt) with marshalling, but it is useful to clients in
other ways.

"Dual interfaces" inherits from IDispatch but as you said we also
need type library for marshaling.

Yes. I don't see any contradiction here. Do you?

Here, somehing ridiculous. Because if client has got type library,
why does he need late binding.

It doesn't strictly need one. It may choose to use one.

For example, scripting languages (such as VBScript or JavaScript)
typically only know how to use IDispatch. Component developer may want
to implement a dual interface to support both early binding (for clients
that find it more convenient, e.g. those written in C++) as well as late
binding (for clients that require it, e.g. those written in VBScript).

He can "import" type library. And
compiler can produce .tlh and .tli file also can produce C++
proxy/stub files.

Not all COM clients are written in C++.
--
With best wishes,
Igor Tandetnik

With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925


.



Relevant Pages

  • Re: Can two interfaces have methods with the same name but different arguments?
    ... Consider working solely with IDispatch. ... the APL2 side that can instantiate a COM object based on a ProgID (which is ... simply a string), that acquires the IDispatch interface of that COM object, ... >> I've written a little code to peruse type libraries so I can see what ...
    (microsoft.public.win32.programmer.ole)
  • Re: Help with interface
    ... > IUnknown is the original interface with AddRef, ... Only late binding. ... IDispatch is the base of automation, ... an interface that extends IDispatch just the way it would ...
    (microsoft.public.win32.programmer.directx.video)
  • Re: Default interface
    ... An IDispatch implementation supports late binding, ... and a custom interface on the same object, and declare the latter to be ... IDispatch and proceed from there. ...
    (microsoft.public.vc.atl)
  • Re: ComInterfaceType.InterfaceIsDual
    ... late binding means calling through the ... IDispatch interface. ... Early binding means that you call interface ... interface derives from IDispatch and possibly has the dual attribute, ...
    (microsoft.public.dotnet.framework.interop)
  • Re: For the AdaOS folks
    ... API that says create/delete an integer? ... >>as an Ada binding, I can do another registry query and get the ... libraries can strengthen the typing of the Ada interface. ...
    (comp.lang.ada)