Problem with IDL imports

B

Babak Asadi

Hi everyone,

I have an ATL Attributed project in VC++.NET 2002 and I'm having the
following idl import problem.

I have the following scenario:

__interface IMyInterface : IUnknown
{
[import("file.idl")];
.....
}

I set the path for file.idl in Project Properties->MIDL->General->Additional
Include Directories

but when I compile I get theMIDL1001 error saying it can't open input file
file.idl

It seems that the Additional Include Directories is being ignored by MIDL or
not being sent to MIDL.

Thanks in advance,
Babak.
 
G

Gary Chang

Hi Babak

Thanks for you posting in the group!

The "Additional Include Directories" under VC7.0 and VC7.1 may be for the
file using include "...".
To use the [import("...")] , you had bettter specify a fullpath filename.


Gary Chang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
 
B

Babak Asadi

Hi Gary,

Thanks for the quick response. In VC6 the "Additional Include
Directories" under MIDL project settings worked for 'import's. I want
to avoid using absolute paths because this complicates matters in a
source control environment.

Each user checks out the source to a local folder so the the absolute
paths would break. I could make absolute paths work if I designate a
specific directory for such files, but that is bad style. Also, since
we have idle files that import other idl files, relative paths won't
work.

Is this a bug in VC7.0?

Thanks again,
Babak.
 
G

Gary Chang

Hi Babak,

Thanks for your quickly response!

I can repro your the problem in the VC7.0, and it doesn't occur in the
VC6.0 as well as VC7.0.

I will consult this issue to the product team, and reply you when I get any
results.


Best regards,
Gary Chang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
 
G

Gary Chang

Hi Babak,

I got some information about this issue:

the linker calls MIDL directly (rather than the project system spawning it
as it does for actual .idl files), so the Setting properties for the midl
tool (the one that the project system spawns) won't have any effect on the
properties that the linker passes through to midl.

However, you can try to provide a response file(eg response.txt) in the
project directory, in that file you can specify the additional include path
as:
/I "D\WUTemp"
then, in the VS.NET 2002 IDE, on the Linker->Embedded IDL page->MIDL
Command, type the response filename(eg response.txt).


Best regards,

Gary Chang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
 
B

Babak Asadi

Hi Gary,

I really appreciate your looking in to this issue and thanks for the
workaround. In the meantime though, I avoided the attributed project.
I'm looking forward to using the new attributes provided in VC
2002/2003 now!

I guess we'll have to wait until a future service pack to get the real
fix?

Best regards,
Babak
 
G

Gary Chang

Hi Babak,

Thanks for your quickly response!

In VC2003, the command */I "D:\WUTemp"* can be directly input into the
Project Property Pages/Linker/Embedded IDL/MIDL Commands entry.

Thanks!


Best regards,
Gary Chang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top