Embedded IDL - how to resolve interdependency? 
Author Message
 Embedded IDL - how to resolve interdependency?

In the header file I define two interfaces:

[object, ...] __interface IFirst
{
    HRESULT Method( [in] ISecond * pVal );

Quote:
};

[object, ...] __interface ISecond
{
    HRESULT Method( [in] IFirst * pVal );

Quote:
};

The question: How to resolve interdependency of these interfaces?

P.S. If I wrtie

__interface ISecond;

before definition of the first interface, MIDL compiler gives an error.



Sat, 06 Nov 2004 15:52:56 GMT  
 Embedded IDL - how to resolve interdependency?
What's __interface? Try interface, without underscores, it's IDL
keyword. MIDL should support forward references.
--
With best wishes,
    Igor Tandetnik

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


Quote:
> In the header file I define two interfaces:

> [object, ...] __interface IFirst
> {
>     HRESULT Method( [in] ISecond * pVal );
> };

> [object, ...] __interface ISecond
> {
>     HRESULT Method( [in] IFirst * pVal );
> };

> The question: How to resolve interdependency of these interfaces?

> P.S. If I wrtie

> __interface ISecond;

> before definition of the first interface, MIDL compiler gives an
error.



Sat, 06 Nov 2004 22:28:48 GMT  
 Embedded IDL - how to resolve interdependency?
__interface is a new keyword that is used in attributed COM code (and
managed extensions). It tells the compiler that this is a COM interface,
rather than just an abstract class.

You can forward declare interfaces like classes. To resolve your circular
dependancy issue here, just forward declare "__interface ISecond;" before
__interface IFirst.

--
Anson Tsao
Visual C++ libraries team

Of course, this posting wouldn't be complete without a nice, juicy
disclaimer from our lawyers: This posting is provided "AS IS" with no
warranties, and confers no rights. You assume all risk for your use. ? 2002
Microsoft Corporation. All rights reserved.


Quote:
> What's __interface? Try interface, without underscores, it's IDL
> keyword. MIDL should support forward references.
> --
> With best wishes,
>     Igor Tandetnik

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



> > In the header file I define two interfaces:

> > [object, ...] __interface IFirst
> > {
> >     HRESULT Method( [in] ISecond * pVal );
> > };

> > [object, ...] __interface ISecond
> > {
> >     HRESULT Method( [in] IFirst * pVal );
> > };

> > The question: How to resolve interdependency of these interfaces?

> > P.S. If I wrtie

> > __interface ISecond;

> > before definition of the first interface, MIDL compiler gives an
> error.



Sun, 07 Nov 2004 01:20:50 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Embedded IDL - how to resolve interdependency?

2. Embedded IDL - how to resolve interdependency?

3. How to resolve interdependency if interfaces? (VC++.NET, embedded IDL)

4. How to resolve interdependency if interfaces? (VC++.NET, embedded IDL)

5. How to resolve interdependency if interfaces? (VC++.NET, embedded IDL)

6. Embedded IDL in VC7

7. importing mshtml.idl in IDL file

8. IDL question - import "msxml2.idl";

9. Including an IDL file in an IDL file

10. Passing parameters from embedded VB to embedded VC++

11. How can I resolve LNK2022 error?

12. Need help with syntax to resolve compiler error.

 

 
Powered by phpBB® Forum Software