CStringArray (how do I include the .h)

  • Thread starter Thread starter Duncan Winn
  • Start date Start date
D

Duncan Winn

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???
 
Thanks,

but it still comes up with the same error??





CheckAbdoul said:
Try
#include <afxwin.h>

instead of
#include <afxcoll.h>

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

#include <afxwin.h> // MFC core and standard components
Duncan Winn said:
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???
 
No I am not including <windows.h> anywhere !!

Thanks,

Duncan




CheckAbdoul said:
Do you have a

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

If so, remove it.

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

Duncan Winn said:
Thanks,

but it still comes up with the same error??





"CheckAbdoul" <636865636B6162646F756C406E6F7370616D2E6D7670732E6F7267> wrote
in message news:[email protected]...
Try
#include <afxwin.h>

instead of
#include <afxcoll.h>

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

#include <afxwin.h> // MFC core and standard components
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???
 
Do you have a

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

If so, remove it.

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

Duncan Winn said:
Thanks,

but it still comes up with the same error??





"CheckAbdoul" <636865636B6162646F756C406E6F7370616D2E6D7670732E6F7267> wrote
in message news:[email protected]...
Try
#include <afxwin.h>

instead of
#include <afxcoll.h>

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

#include <afxwin.h> // MFC core and standard components
Duncan Winn said:
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???
 
Duncan Winn said:
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
 
What kind of app is this? And can you show us the includes you do have?

--
Adam Clauss
(e-mail address removed)
Duncan Winn said:
No I am not including <windows.h> anywhere !!

Thanks,

Duncan




"CheckAbdoul" <636865636B6162646F756C406E6F7370616D2E6D7670732E6F7267> wrote
in message news:[email protected]...
Do you have a

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

If so, remove it.

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

Duncan Winn said:
Thanks,

but it still comes up with the same error??





"CheckAbdoul" <636865636B6162646F756C406E6F7370616D2E6D7670732E6F7267> wrote
in message Try
#include <afxwin.h>

instead of
#include <afxcoll.h>
afxcol.h
my
compiler (VS.NET) complains that...

WINDOWS.H already included. MFC apps must not #include
Any suggestions???
 
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 said:
No I am not including <windows.h> anywhere !!

Thanks,

Duncan




"CheckAbdoul" <636865636B6162646F756C406E6F7370616D2E6D7670732E6F7267> wrote
in message news:[email protected]...
Do you have a

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

If so, remove it.

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

Duncan Winn said:
Thanks,

but it still comes up with the same error??





"CheckAbdoul" <636865636B6162646F756C406E6F7370616D2E6D7670732E6F7267> wrote
in message Try
#include <afxwin.h>

instead of
#include <afxcoll.h>
afxcol.h
my
compiler (VS.NET) complains that...

WINDOWS.H already included. MFC apps must not #include
Any suggestions???
 
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
 
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 said:
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 said:
No I am not including <windows.h> anywhere !!

Thanks,

Duncan




"CheckAbdoul" <636865636B6162646F756C406E6F7370616D2E6D7670732E6F7267> wrote
in message news:[email protected]...
Do you have a

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

If so, remove it.

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

Thanks,

but it still comes up with the same error??





"CheckAbdoul"
wrote
in message Try
#include <afxwin.h>

instead of
#include <afxcoll.h>

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

#include <afxwin.h> // MFC core and standard components
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
Any suggestions???
 
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 said:
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" <636865636B6162646F756C406E6F7370616D2E6D7670732E6F7267> wrote
in message news:[email protected]...
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 said:
No I am not including <windows.h> anywhere !!

Thanks,

Duncan




"CheckAbdoul" <636865636B6162646F756C406E6F7370616D2E6D7670732E6F7267> wrote
in message Do you have a

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

If so, remove it.

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

Thanks,

but it still comes up with the same error??





"CheckAbdoul"
wrote
in message Try
#include <afxwin.h>

instead of
#include <afxcoll.h>

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

#include <afxwin.h> // MFC core and standard components
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
Any suggestions???
 
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???
 
Back
Top