473,405 Members | 2,262 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

CStringArray (how do I include the .h)

I would like to use CStringArray, but when I try to include afxcol.h my
compiler (VS.NET) complains that...

WINDOWS.H already included. MFC apps must not #include <windows.h>

Any suggestions???
Nov 16 '05 #1
11 10088
Try
#include <afxwin.h>

instead of
#include <afxcoll.h>

--
Cheers
Check Abdoul [ VC++ MVP ]
-----------------------------------

#include <afxwin.h> // MFC core and standard components
"Duncan Winn" <te**@test1.co.uk> wrote in message
news:Os**************@tk2msftngp13.phx.gbl...
I would like to use CStringArray, but when I try to include afxcol.h my
compiler (VS.NET) complains that...

WINDOWS.H already included. MFC apps must not #include <windows.h>

Any suggestions???

Nov 16 '05 #2
Thanks,

but it still comes up with the same error??

"CheckAbdoul" <636865636B6162646F756C406E6F7370616D2E6D7670732E6 F7267> wrote
in message news:uq**************@TK2MSFTNGP12.phx.gbl...
Try
#include <afxwin.h>

instead of
#include <afxcoll.h>

--
Cheers
Check Abdoul [ VC++ MVP ]
-----------------------------------

#include <afxwin.h> // MFC core and standard components
"Duncan Winn" <te**@test1.co.uk> wrote in message
news:Os**************@tk2msftngp13.phx.gbl...
I would like to use CStringArray, but when I try to include afxcol.h my
compiler (VS.NET) complains that...

WINDOWS.H already included. MFC apps must not #include <windows.h>

Any suggestions???


Nov 16 '05 #3
Do you have a

#include <windows.h>
before including
#include <afxwin.h>

If so, remove it.

--
Cheers
Check Abdoul [ VC++ MVP ]
-----------------------------------

"Duncan Winn" <te**@test1.co.uk> wrote in message
news:eU*************@TK2MSFTNGP11.phx.gbl...
Thanks,

but it still comes up with the same error??

"CheckAbdoul" <636865636B6162646F756C406E6F7370616D2E6D7670732E6 F7267> wrote in message news:uq**************@TK2MSFTNGP12.phx.gbl...
Try
#include <afxwin.h>

instead of
#include <afxcoll.h>

--
Cheers
Check Abdoul [ VC++ MVP ]
-----------------------------------

#include <afxwin.h> // MFC core and standard components
"Duncan Winn" <te**@test1.co.uk> wrote in message
news:Os**************@tk2msftngp13.phx.gbl...
I would like to use CStringArray, but when I try to include afxcol.h my compiler (VS.NET) complains that...

WINDOWS.H already included. MFC apps must not #include <windows.h>

Any suggestions???



Nov 16 '05 #4
No I am not including <windows.h> anywhere !!

Thanks,

Duncan


"CheckAbdoul" <636865636B6162646F756C406E6F7370616D2E6D7670732E6 F7267> wrote
in message news:uI*************@TK2MSFTNGP11.phx.gbl...
Do you have a

#include <windows.h>
before including
#include <afxwin.h>

If so, remove it.

--
Cheers
Check Abdoul [ VC++ MVP ]
-----------------------------------

"Duncan Winn" <te**@test1.co.uk> wrote in message
news:eU*************@TK2MSFTNGP11.phx.gbl...
Thanks,

but it still comes up with the same error??

"CheckAbdoul" <636865636B6162646F756C406E6F7370616D2E6D7670732E6 F7267>

wrote
in message news:uq**************@TK2MSFTNGP12.phx.gbl...
Try
#include <afxwin.h>

instead of
#include <afxcoll.h>

--
Cheers
Check Abdoul [ VC++ MVP ]
-----------------------------------

#include <afxwin.h> // MFC core and standard components
"Duncan Winn" <te**@test1.co.uk> wrote in message
news:Os**************@tk2msftngp13.phx.gbl...
> I would like to use CStringArray, but when I try to include afxcol.h my > compiler (VS.NET) complains that...
>
> WINDOWS.H already included. MFC apps must not #include <windows.h>
>
> Any suggestions???
>
>



Nov 16 '05 #5
"Duncan Winn" <te**@test1.co.uk> wrote in message
news:ed**************@TK2MSFTNGP12.phx.gbl...
No I am not including <windows.h> anywhere !!


If all else fails, try turning off the precompiled header option (at least
temporarily) and then rebuild everything.

Regards,
Will
Nov 16 '05 #6
What kind of app is this? And can you show us the includes you do have?

--
Adam Clauss
ca*****@tamu.edu
"Duncan Winn" <te**@test1.co.uk> wrote in message
news:ed**************@TK2MSFTNGP12.phx.gbl...
No I am not including <windows.h> anywhere !!

Thanks,

Duncan


"CheckAbdoul" <636865636B6162646F756C406E6F7370616D2E6D7670732E6 F7267> wrote in message news:uI*************@TK2MSFTNGP11.phx.gbl...
Do you have a

#include <windows.h>
before including
#include <afxwin.h>

If so, remove it.

--
Cheers
Check Abdoul [ VC++ MVP ]
-----------------------------------

"Duncan Winn" <te**@test1.co.uk> wrote in message
news:eU*************@TK2MSFTNGP11.phx.gbl...
Thanks,

but it still comes up with the same error??

"CheckAbdoul" <636865636B6162646F756C406E6F7370616D2E6D7670732E6 F7267>

wrote
in message news:uq**************@TK2MSFTNGP12.phx.gbl...
> Try
> #include <afxwin.h>
>
> instead of
> #include <afxcoll.h>
>
> --
> Cheers
> Check Abdoul [ VC++ MVP ]
> -----------------------------------
>
> #include <afxwin.h> // MFC core and standard components
> "Duncan Winn" <te**@test1.co.uk> wrote in message
> news:Os**************@tk2msftngp13.phx.gbl...
> > I would like to use CStringArray, but when I try to include afxcol.h
my
> > compiler (VS.NET) complains that...
> >
> > WINDOWS.H already included. MFC apps must not #include

<windows.h> > >
> > Any suggestions???
> >
> >
>
>



Nov 16 '05 #7
The error indicates that you are including <windows.h> somewhere. Search
for the text "windows.h" in your project directory and see it if is included
in any header file that gets added before stdafx.h.

--
Cheers
Check Abdoul [ VC++ MVP ]
-----------------------------------

"Duncan Winn" <te**@test1.co.uk> wrote in message
news:ed**************@TK2MSFTNGP12.phx.gbl...
No I am not including <windows.h> anywhere !!

Thanks,

Duncan


"CheckAbdoul" <636865636B6162646F756C406E6F7370616D2E6D7670732E6 F7267> wrote in message news:uI*************@TK2MSFTNGP11.phx.gbl...
Do you have a

#include <windows.h>
before including
#include <afxwin.h>

If so, remove it.

--
Cheers
Check Abdoul [ VC++ MVP ]
-----------------------------------

"Duncan Winn" <te**@test1.co.uk> wrote in message
news:eU*************@TK2MSFTNGP11.phx.gbl...
Thanks,

but it still comes up with the same error??

"CheckAbdoul" <636865636B6162646F756C406E6F7370616D2E6D7670732E6 F7267>

wrote
in message news:uq**************@TK2MSFTNGP12.phx.gbl...
> Try
> #include <afxwin.h>
>
> instead of
> #include <afxcoll.h>
>
> --
> Cheers
> Check Abdoul [ VC++ MVP ]
> -----------------------------------
>
> #include <afxwin.h> // MFC core and standard components
> "Duncan Winn" <te**@test1.co.uk> wrote in message
> news:Os**************@tk2msftngp13.phx.gbl...
> > I would like to use CStringArray, but when I try to include afxcol.h
my
> > compiler (VS.NET) complains that...
> >
> > WINDOWS.H already included. MFC apps must not #include

<windows.h> > >
> > Any suggestions???
> >
> >
>
>



Nov 16 '05 #8
Adam,
What kind of app is this?
An Ole Db Provider
And can you show us the includes you do have?


in the stdafx.h...............
#include <atlbase.h>
#include <atlcom.h>
#include <atlwin.h>
#include <atltypes.h>
#include <atlctl.h>
#include <atlhost.h>
#include <atldb.h>

in my curerent file ...............
stdafx.h
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <String.h>
#include <iostream.h>
#include <atlpath.h>

Thanks

Duncan
Nov 16 '05 #9
Check,

I can not see any place windows.h is includes explicitly. However my
application is an Ole Db provider created using the ATL, and I believe the
ATL may use windows.h?
"CheckAbdoul" <636865636B6162646F756C406E6F7370616D2E6D7670732E6 F7267> wrote
in message news:uU**************@TK2MSFTNGP09.phx.gbl...
The error indicates that you are including <windows.h> somewhere. Search for the text "windows.h" in your project directory and see it if is included in any header file that gets added before stdafx.h.

--
Cheers
Check Abdoul [ VC++ MVP ]
-----------------------------------

"Duncan Winn" <te**@test1.co.uk> wrote in message
news:ed**************@TK2MSFTNGP12.phx.gbl...
No I am not including <windows.h> anywhere !!

Thanks,

Duncan


"CheckAbdoul" <636865636B6162646F756C406E6F7370616D2E6D7670732E6 F7267>

wrote
in message news:uI*************@TK2MSFTNGP11.phx.gbl...
Do you have a

#include <windows.h>
before including
#include <afxwin.h>

If so, remove it.

--
Cheers
Check Abdoul [ VC++ MVP ]
-----------------------------------

"Duncan Winn" <te**@test1.co.uk> wrote in message
news:eU*************@TK2MSFTNGP11.phx.gbl...
> Thanks,
>
> but it still comes up with the same error??
>
>
>
>
>
> "CheckAbdoul" <636865636B6162646F756C406E6F7370616D2E6D7670732E6 F7267> wrote
> in message news:uq**************@TK2MSFTNGP12.phx.gbl...
> > Try
> > #include <afxwin.h>
> >
> > instead of
> > #include <afxcoll.h>
> >
> > --
> > Cheers
> > Check Abdoul [ VC++ MVP ]
> > -----------------------------------
> >
> > #include <afxwin.h> // MFC core and standard components
> > "Duncan Winn" <te**@test1.co.uk> wrote in message
> > news:Os**************@tk2msftngp13.phx.gbl...
> > > I would like to use CStringArray, but when I try to include afxcol.h my
> > > compiler (VS.NET) complains that...
> > >
> > > WINDOWS.H already included. MFC apps must not #include <windows.h> > > >
> > > Any suggestions???
> > >
> > >
> >
> >
>
>



Nov 16 '05 #10
See if the following utility helps you to figure out where the windows.h is
coming from.

http://www.codeguru.com/samples/Includes.shtml

--
Cheers
Check Abdoul [ VC++ MVP ]
-----------------------------------

"Duncan Winn" <te**@test1.co.uk> wrote in message
news:ua**************@TK2MSFTNGP12.phx.gbl...
Check,

I can not see any place windows.h is includes explicitly. However my
application is an Ole Db provider created using the ATL, and I believe the
ATL may use windows.h?
"CheckAbdoul" <636865636B6162646F756C406E6F7370616D2E6D7670732E6 F7267> wrote in message news:uU**************@TK2MSFTNGP09.phx.gbl...
The error indicates that you are including <windows.h> somewhere.

Search
for the text "windows.h" in your project directory and see it if is

included
in any header file that gets added before stdafx.h.

--
Cheers
Check Abdoul [ VC++ MVP ]
-----------------------------------

"Duncan Winn" <te**@test1.co.uk> wrote in message
news:ed**************@TK2MSFTNGP12.phx.gbl...
No I am not including <windows.h> anywhere !!

Thanks,

Duncan


"CheckAbdoul" <636865636B6162646F756C406E6F7370616D2E6D7670732E6 F7267>

wrote
in message news:uI*************@TK2MSFTNGP11.phx.gbl...
> Do you have a
>
> #include <windows.h>
> before including
> #include <afxwin.h>
>
> If so, remove it.
>
> --
> Cheers
> Check Abdoul [ VC++ MVP ]
> -----------------------------------
>
> "Duncan Winn" <te**@test1.co.uk> wrote in message
> news:eU*************@TK2MSFTNGP11.phx.gbl...
> > Thanks,
> >
> > but it still comes up with the same error??
> >
> >
> >
> >
> >
> > "CheckAbdoul" <636865636B6162646F756C406E6F7370616D2E6D7670732E6 F7267> > wrote
> > in message news:uq**************@TK2MSFTNGP12.phx.gbl...
> > > Try
> > > #include <afxwin.h>
> > >
> > > instead of
> > > #include <afxcoll.h>
> > >
> > > --
> > > Cheers
> > > Check Abdoul [ VC++ MVP ]
> > > -----------------------------------
> > >
> > > #include <afxwin.h> // MFC core and standard components
> > > "Duncan Winn" <te**@test1.co.uk> wrote in message
> > > news:Os**************@tk2msftngp13.phx.gbl...
> > > > I would like to use CStringArray, but when I try to include

afxcol.h
> my
> > > > compiler (VS.NET) complains that...
> > > >
> > > > WINDOWS.H already included. MFC apps must not #include

<windows.h>
> > > >
> > > > Any suggestions???
> > > >
> > > >
> > >
> > >
> >
> >
>
>



Nov 16 '05 #11
Thanks Check,

I believe that as I am writing an Ole Db provider the atlbase.h or some
other atl component includes windows.h. So I moved my
#include afxwin.h into the stdafx.h before the following:

#include <atlbase.h>
#include <atlcom.h>
#include <atlwin.h>
#include <atltypes.h>
#include <atlctl.h>
#include <atlhost.h>
#include <atldb.h>

This overcame the windows.h problem but this gave the error....

C2065: 'AtlAllocTaskWideString' : undeclared identifier.

So I got over this by including afxdtctl.h. However when I did this I
got the following errors...

CDFProv error LNK2005: _DllMain@12 already defined in CDFProv.obj
CDFProv error LNK2001: unresolved external symbol ___argc
CDFProv error LNK2001: unresolved external symbol ___argv
CDFProv error LNK2001: unresolved external symbol __mbctype
CDFProv error LNK2001: unresolved external symbol __mbctype

So I also then placed define _AFXDLL before all the #includes
Which left me with the error.....

_DllMain@12 already defined in CDFProv.obj

I was told a way to overcoming this about telling the compiler to ignore
the lib files and then include them in order. I did that but it still
did not get rid of the error??
Any further suggestions???
Nov 16 '05 #12

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Mylinux | last post by:
program was taken from http://www.beyondlogic.org/parlcd/parlcd.htm when compile under rh 9.0 I do not know how to correct this error. can u help? there is dos.h in my linux box.
26
by: Oplec | last post by:
Hi, I am learning standard C++ as a hobby. The C++ Programming Language : Special Edition has been the principal source for my information. I read the entirety of the book and concluded that I...
7
by: Piotre Ugrumov | last post by:
I have tried to write the class Student(Studente), Teacher(Docente). This classes derive from the class Person. In a class university(facoltą). I have tried to create an array of Student and an...
2
by: learning_C++ | last post by:
Hi, I found some example code about server and client applications. But I can not run server and client in different computers. Now, I only run them in the different windows in Linux. I hope to...
138
by: Ian Boyd | last post by:
i've been thrown into a pit with DB2 and have to start writing things such as tables, indexes, stored procedures, triggers, etc. The online reference is only so helpful. The two pdf manuals are...
9
by: Anubhav Jain | last post by:
Hi, I am having few .net source files(.cs or .vb) and I want to dynamically generate the corresponding .net project file(.csproj or .vbproj) for them without using visual studio.So that I could...
1
by: å¼ ę²ˆé¹ | last post by:
How to compile the HelloWorld of boost.asio? Maybe this is a stupid problem , but I really don't konw how to find the right way. My compile environment is WinXP, Msys , MinGw , G++ 3.4.2,...
11
by: skumar434 | last post by:
Hi everybody, I am faceing problem while assigning the memory dynamically to a array of structures . Suppose I have a structure typedef struct hom_id{ int32_t nod_de; int32_t hom_id;
65
by: Hongyu | last post by:
Dear all: I am trying to write to a file with full directory name and file name specified (./outdir/mytestout.txt where . is the current directory) in C programming language and under Unix, but...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.