MIDL in VS 2003 creates corrupt tlh files when msado15.idl is included in another idl?

K

Ken Ekberg

Hello everyone,

I am moving an ATL project from VC6 to VS .NET 2003. It builds fine in VC6,
but I am having problems with ADO on VS 2003.
It appears that if I use the msado15.idl included with VS 2003, I get the
error "error C2146: syntax error : missing ';' before identifier
'PositionEnum_Param'"

My IDL imports the msado15.idl. In stdafx.h, the .tlb is #imported and
therefore gets everything, including ADO.

The following is a snapshot of the corrupt tlh-file:

typedef PositionEnum PositionEnum_Param;
typedef enum __MIDL___MIDL_itf_MyProject_0258_0013 PositionEnum;
enum __MIDL___MIDL_itf_MyProject_0258_0013;

The manually corrected version is:
typedef enum __MIDL___MIDL_itf_MyProject_0258_0013 PositionEnum;
enum __MIDL___MIDL_itf_MyProject_0258_0013;
typedef PositionEnum PositionEnum_Param;

If I remove the #import of the .tlb and #include the .tlh file that I alter
to correct the ordering, it seems to build ok. But it is not the solution I
am looking for.

If I change the IDL to import the msado15.idl including with VC6, I get a
lot of warnings - but no errors. So I figure there must be something with
the file shipped with VS 2003.

Thanks,
Ken Ekberg
 

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