Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Compile Errors - windows.h and System::Windows::Forms conflict

Status
Not open for further replies.

delali

Programmer
Aug 20, 2001
8
US
Compile Errors - windows.h and System::Windows::Forms conflict I am having problems getting my VC++ code to compile. Below are the files as they are defined.
I am using win 2K, VC++ .NET



nidaq.h
**************************************************************************************
#include "stdafx.h"
#include "ChartForm.h"
#ifndef _NIDAQ_Header_
#define _NIDAQ_Header_

/*************************************************************************
*
* NI-DAQ Windows - Function Prototypes
* Copyright (C) National Instruments 1995.
*
*************************************************************************/


#include <windows.h>
...

*************************************************************************************




ChartForm.h
*************************************************************************************
#ifndef CHART_FORM_H
#define CHART_FORM_H

#include <tchar.h>

#using <mscorlib.dll>


#using <System.dll>
#using <System.Windows.Forms.dll>
#using <System.Drawing.dll>
#using <ChartFX.dll>
#using <ChartFX.Base.dll>
#using <ChartFX.Borders.dll>


using namespace System;
using namespace System::ComponentModel;
using namespace System::Windows::Forms;
using namespace System::Drawing;
using namespace SoftwareFX::ChartFX;


...

*************************************************************************************



ChartForm.cpp
**************************************************************************************
#include &quot;stdafx.h&quot;
#include &quot;nidaq.h&quot;



#include &quot;ChartForm.h&quot;





I am not sure how to move forward, nidaq.h needs windows.h to compile correctly. But this is causing the conflict. I am not sure how to get around this

Warnings/Errors:


C:\Program Files\Microsoft Visual Studio .NET\Vc7\atlmfc\include\afxv_w32.h(18) : fatal error C1189: #error : WINDOWS.H already included. MFC apps must not #include <windows.h>




C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\ObjIdl.h(248) : warning C4935: assembly access specifier modified from 'public'

C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\ObjIdl.h(260) : warning C4935: assembly access specifier modified from 'public'

C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\ObjIdl.h(7374) : error C2872: 'IDataObject' : ambiguous symbol

could be 'C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\ObjIdl.h(248) : System::Windows::Forms::IDataObject IDataObject'

or 'c:\Documents and Settings\dzirad1.JHUAPL\Desktop\CHARTING
Trial\NarwalChart\ChartForm.h(12) : System::Windows::Forms::IDataObject'

C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\ObjIdl.h(7388) : error C2371: 'IDataObject' : redefinition; different basic types
C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\ObjIdl.h(248) : see declaration of 'IDataObject'





C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\ObjIdl.h(7851) : error C2872: 'IMessageFilter' : ambiguous symbol
could be 'C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\ObjIdl.h(260) : System::Windows::Forms::IMessageFilter IMessageFilter'
or 'c:\Documents and Settings\dzirad1.JHUAPL\Desktop\CHARTING Trial\NarwalChart\ChartForm.h(12) : System::Windows::Forms::IMessageFilter'

C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\ObjIdl.h(7897) :
error C2371: 'IMessageFilter' : redefinition; different basic types
C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\ObjIdl.h(260) : see declaration of 'IMessageFilter'



c:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\OleIdl.h(641) : error C3383: 'IOleCache2::UpdateCache' : in an unmanaged class, a virtual member function cannot have a managed type in the signature

c:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\OleIdl.h(799) : error C3383: 'IOleCacheControl::OnRun' : in an unmanaged class, a virtual member function cannot have a managed type in the signature


c:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\ServProv.h(47) : warning C4935: assembly access specifier modified from 'public'
c:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\ServProv.h(92) : error C2872: 'IServiceProvider' : ambiguous symbol
could be 'c:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\ServProv.h(47) : System::IServiceProvider IServiceProvider'
or 'c:\Documents and Settings\dzirad1.JHUAPL\Desktop\CHARTING Trial\NarwalChart\ChartForm.h(7) : System::IServiceProvider'

c:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\ServProv.h(99) : error C2371: 'IServiceProvider' : redefinition; different basic types
c:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\ServProv.h(47) : see declaration of 'IServiceProvider'



Is there a way to make the symbols explicitly know which definition to use?


Any assistance would be greatly appreciated.

Delali Dzirasa




 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top