Seeing an interface in a type library 
Author Message
 Seeing an interface in a type library

Hi All

Can anyone tell me how to force an interface definition to be included in
the type library.

I have an IDL file in which I define an interface. Objects within my project
do not implement the interface but make reference it. I would like to be
able to write seperate implementations of this interface in different ATL
DLLs, but when I examine the TLB from the original project the interface
definition has been removed.

(I have a container object onto which a filter object may be set. The filter
object is then implemented by the client of the container object.)

A related question: If I #import the original IDL file into my new IDL file
the project completely rebuilds each time I compile even if nothing has
changed. Is there any way to stop this happening?

Am I using completely the wrong approach?

Many thanks

Gavin



Tue, 20 Jul 2004 23:16:17 GMT  
 Seeing an interface in a type library
Mention the interface in the library block:

[...]
interface IMyInterface {};

library MyLib
{
    interface IMyInterface;

Quote:
};

In the IDL files that uses this interface, import this IDL outside the
library block and importlib the TLB built from this IDL inside the
library block.
--
With best wishes,
    Igor Tandetnik

"For every complex problem, there is a solution that is simple, neat,
and wrong." H.L. Mencken


Quote:
> Hi All

> Can anyone tell me how to force an interface definition to be included
in
> the type library.

> I have an IDL file in which I define an interface. Objects within my
project
> do not implement the interface but make reference it. I would like to
be
> able to write seperate implementations of this interface in different
ATL
> DLLs, but when I examine the TLB from the original project the
interface
> definition has been removed.

> (I have a container object onto which a filter object may be set. The
filter
> object is then implemented by the client of the container object.)

> A related question: If I #import the original IDL file into my new IDL
file
> the project completely rebuilds each time I compile even if nothing
has
> changed. Is there any way to stop this happening?

> Am I using completely the wrong approach?

> Many thanks

> Gavin



Wed, 21 Jul 2004 02:54:40 GMT  
 Seeing an interface in a type library
Hi Gavin,

Quote:
> A related question: If I #import the original IDL file into my new IDL file
> the project completely rebuilds each time I compile even if nothing has
> changed. Is there any way to stop this happening?

This is a hassle. What you need to do is go to project settings,
select your "interface-only IDL" and check the Exclude from Build box.
However, you need to make sure it is built at least once, to produce
the output .h and _i.c files.

Hope that helps,
Kim



Fri, 23 Jul 2004 21:23:32 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Interface with Interface pointer from imported type library as argument

2. Injection of other interfaces into a type library.

3. implementing interfaces from a type library

4. Reusing type libraries for reimplementing Interfaces

5. Exposing DirectDraw interfaces in a type library

6. New interface can be seen

7. Exposing interfaces in a type library that are infact defined in another type library.

8. Weird typing error not seen by gcc.

9. Custom UserControl enum type cannot be seen by designer

10. MessengerAPI type library - IDispatch enum type problem

11. HRESULT return type turns into void when adding class from type library

12. Explicit interface members with different return types in MC++

 

 
Powered by phpBB® Forum Software