Every time I add a particular form to my VS 2003 C++ project, the project
can no longer compile. The error message indicates an ambiguity because
IDataObj is defined both in System::Windows::Forms and also in objdl.h.

I have no idea why objidl.h is being included in my project, but it must
have something to do with the objects in my form other than controls. There
are no COM objects involved.

The problem line in objidl.h is line 7408:

typedef /* [unique] */ IDataObject *LPDATAOBJECT;

Can anyone help me get past this compiler error? And maybe explain how
objidl.h gets included in my project?

Thanks for any help.

Re: Objidl.h problem by Steve

Steve
Sun Sep 05 22:44:23 CDT 2004

This problem disappeared when I included the line

#define WIN32_LEAN_AND_MEAN

in stdafx.h. I had previously commented that line out while researching a
different problem.

I have no idea why this solved the problem, but it must have eliminated
objidl.h from the #include list.


"Steve Strommen" <sjstrommen@wi.rr.com> wrote in message
news:%23pn%23gVskEHA.2812@tk2msftngp13.phx.gbl...
> Every time I add a particular form to my VS 2003 C++ project, the project
> can no longer compile. The error message indicates an ambiguity because
> IDataObj is defined both in System::Windows::Forms and also in objdl.h.
>
> I have no idea why objidl.h is being included in my project, but it must
> have something to do with the objects in my form other than controls.
There
> are no COM objects involved.
>
> The problem line in objidl.h is line 7408:
>
> typedef /* [unique] */ IDataObject *LPDATAOBJECT;
>
> Can anyone help me get past this compiler error? And maybe explain how
> objidl.h gets included in my project?
>
> Thanks for any help.
>
>