Problem using a COM interface as parameter

Posted by Cesar on Stack Overflow See other posts from Stack Overflow or by Cesar
Published on 2009-07-29T19:30:11Z Indexed on 2010/03/19 12:01 UTC
Read the original article Hit count: 210

Filed under:

I have the following problem:

I have to projects Project1 and Project2. In Project1 I have an interface IMyInterface. In Project2 I have an interface IMyInterface2 with a method that receives a pointer to IMyInterface1.

When I use import "Project1.idl"; in my Project2.idl, a #include "Project1.h" appears in Project2___i.h. But this file does not even exist!. What is the proper way to import an interface defined into other library into a idl file?

I tried to replace the #include "Project1.h" by *#include "Project1_i.h"* or *#include "Project1_i.c"*, but it gave me a lot of errors.

I also tried to use importlib("Project1.tlb") and define my interface IMyInterface2 within the library definition. But when I compile Project2PS project, an error is raised (something like dlldata.c is not generated if no interface is defined).

I tried to create a dummy Project1.h. But when Project2___i.h is compiled, compiler cannot find MyInterface1. And if I include Project1___i.h I get a lot of errors again!

Apparently, it is a simple issue, but I don't know how to solve it. I'm stuck with that!.

By the way, I'm using VS2008 SP1.

Thanks in advance.

© Stack Overflow or respective owner

Related posts about atl