GIDForums  

Go Back   GIDForums > Computer Programming Forums > MS Visual C++ / MFC Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 05-May-2008, 23:23
diyora diyora is offline
New Member
 
Join Date: May 2008
Posts: 1
diyora is on a distinguished road

fatal error C1189: #error : WINDOWS.H already included.


Hello all,

My stdafx.h file contain:

CPP / C++ / C Code:
#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..
Last edited by LuciWiz : 09-May-2008 at 07:14. Reason: Please insert your C/C++ code between [cpp] & [/cpp] tags
 
 

Recent GIDBlogToyota - 2008 July Promotion by Nihal

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Reliable & Affordable.. RVSKIN|PHP5|FANTASTICO|CPANEL and much more.. + Coupon!! .amaZe Web Hosting Advertisements & Offers 0 16-Feb-2008 10:43
Free Hosting From FridayHosting crazyboy168 Free Web Hosting 0 30-Nov-2007 12:02

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 15:16.


vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.