Forum     

Go Back   Digit Technology Discussion Forum > Software > Programming
Register FAQ Calendar Mark Forums Read

Programming The destination for developers - C, C++, Java, Python and the lot


Closed Thread
 
LinkBack Thread Tools Display Modes
Old 06-05-2008, 12:09 PM   #1 (permalink)
Right Off the Assembly Line
 
Join Date: May 2008
Posts: 2
Default fatal error C1189: #error : WINDOWS.H already included.


Hello all,

My stdafx.h file contain:

#pragma once

// Modify the following defines if you have to target a platform prior to the ones specified below.
// Refer to MSDN for the latest info on corresponding values for different platforms.
#ifndef WINVER // Allow use of features specific to Windows XP or later.
#define WINVER 0x0501 // Change this to the appropriate value to target other versions of Windows.
#endif
#ifndef _WIN32_WINNT // Allow use of features specific to Windows XP or later.
#define _WIN32_WINNT 0x0501 // Change this to the appropriate value to target other versions of Windows.
#endif
#ifndef _WIN32_WINDOWS // Allow use of features specific to Windows 98 or later.
#define _WIN32_WINDOWS 0x0410 // Change this to the appropriate value to target Windows Me or later.
#endif
#ifndef _WIN32_IE // Allow use of features specific to IE 6.0 or later.
#define _WIN32_IE 0x0600 // Change this to the appropriate value to target other versions of IE.
#endif
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
// Windows Header Files:
#include <windows.h>
// C RunTime Header Files
#include <stdlib.h>
#include <malloc.h>
#include <memory.h>
#include <tchar.h>

My abc.h file contain:

#include <afxwin.h>
#include <stdio.h>
#include <winsock2.h>
#include <conio.h>
#include <iostream>
using namespace std;

class CIPMessage
{
public:
CIPMessage();
~CIPMessage();
void Init(string sIpAddress, int iPort);
int SendMessagePort(string sMessage);
int RecMessagePort();
bool IsConnected(){return m_bIsConnected;}
private:
bool m_bIsConnected; // true - connected false - not connected
string m_sServerIPAddress;
int m_iServerPort;
SOCKET conn; // socket connected to server
};

I define this both header file in my main source file.But it give me an error:
c:\program files\microsoft visual studio 8\vc\atlmfc\include\afxv_w32.h(16) : fatal error C1189: #error : WINDOWS.H already included. MFC apps must not #include <windows.h>.

I see the related question and change corresponds.but it give me error.When i remove the windows.h then write afxwin.h then main source file some variable undeclared identifier.

please help me..
diyora is offline  
Advertisements. Register and be a member of the community to get rid of them.
Advertisement

Old 06-05-2008, 06:56 PM   #2 (permalink)
Legen-wait for it-dary!
 
dheeraj_kumar's Avatar
 
Join Date: Dec 2004
Location: Chennai
Posts: 2,471
Default Re: fatal error C1189: #error : WINDOWS.H already included.

I'm not sure, but remove windows.h, write afxwin.h, and solve the undeclared variable problem. It might work.
__________________
If the Start Windows Restart when Windows starts check box is checked Windows Restart will start automatically every time Windows is started. - Actual excerpt from a windows program help file
dheeraj_kumar is offline  
Old 07-05-2008, 11:57 AM   #3 (permalink)
Right Off the Assembly Line
 
Join Date: May 2008
Posts: 2
Default Re: fatal error C1189: #error : WINDOWS.H already included.

Hi,
this give me error about variable which is in .cpp file...
diyora is offline  
Old 07-05-2008, 02:31 PM   #4 (permalink)
Legen-wait for it-dary!
 
dheeraj_kumar's Avatar
 
Join Date: Dec 2004
Location: Chennai
Posts: 2,471
Default Re: fatal error C1189: #error : WINDOWS.H already included.

Then correct it...
__________________
If the Start Windows Restart when Windows starts check box is checked Windows Restart will start automatically every time Windows is started. - Actual excerpt from a windows program help file
dheeraj_kumar is offline  
Closed Thread

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
HELP!!!!! Fatal Sytem Error!! trublu Hardware Q&A 2 12-01-2008 01:24 PM
please help: STOP:0xhhhhhhhh {Fatal System Error} and many more lalit_nagalkar Software Q&A 4 21-08-2007 07:33 PM
Window display fatal Error during startUp Kaushal Hiwarkar Software Q&A 2 13-05-2007 12:23 PM
Firefox: Fatal error in videodownloader plugin Rollercoaster Software Q&A 10 22-08-2006 06:37 PM
Windows XP Booting and Installation Error (LILO Error) arijitraja Software Q&A 3 26-02-2006 03:32 PM

 
Latest Threads
- by Sujeet
- by clmlbx
- by Sujeet
- by icebags

Advertisement




All times are GMT +5.5. The time now is 10:59 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.

Search Engine Optimization by vBSEO 3.3.2