in the name of allah
hi everyone
i work with visual C++ 2008 and i'm a project that contains the c and c++ code together.
the project worked correctly but when i add a .cpp and a .h file to the project, the project
errors the c1189 : MFC requires to use winsock2.h
.
look the codes in the .cpp and .h files are correctly because when i add these files to another mfc project will work,
but when add to my project this error will happen.
can you tell me what the problem is?
first part of the my .h file is like below :
___
#pragma once
#ifdef _WINDOWS_
#undef _WINDOWS_
#endif
#include <Afx.h>
#include <afxwin.h>
#include <atlimage.h>
#include <math.h>
___
in addition i need to use the CWnd and CString and CImage ,... Classes in my project, because of this include the afxwin.h(for CWnd) and atlimage.h(for CImage) and ....
so i have to do these, don't i?
remaining part of .h file is :
___
class Object{
public:
CImage Image;
short int x,y;
};
class Theme : public CWnd{
private:
protected:
virtual void DoDataExchange(CDataExchange* pDX);
public:
CWnd *Parent;
CPoint cursor;
bool drag;
CString path,imagepath;
char DialogMove; char code,sb; short int iimage,bstart,bend, ib; short int w, h,D;
float ani_p, ani_max;
bool ani,mousec;
CRect WRect,rdesktop;
CDC *cdc;
short int lani;
HWND hwndani;
Object *Image;
CRect *Rect;
bool *BEnable; unsigned char ButtonCount,ImageCount,SysButtonCount;
bool Transparent;
int EndMsg;
void GotoPage(unsigned char PageNo,unsigned char BStart,unsigned char BEnd);
void ClearRect(short i,short j,COLORREF color);
bool IsIn(CPoint point,CRect rect);
bool IsInRect(CPoint point,CRect rect,CRect Rectangle);
void Center2Top(int);
void Top2Center();
void Down2Center();
void Center2Down();
bool AddImage(unsigned char Index,CString ImagePath,unsigned short int X,short int Y);
void AddButton(unsigned char Index,CRect rectangle,bool enable);
void DrawImages(unsigned char alpha,int IImage);
void Init(unsigned char imagecount,unsigned char buttoncount,unsigned char sysbuttoncount);
~Theme(void);
bool CreateTheme(CRect rect,CWnd *parent,unsigned short int W,unsigned short int H,bool transparent);
afx_msg void OnPaint();
afx_msg void OnTimer(UINT_PTR nIDEvent);
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
DECLARE_MESSAGE_MAP()
};
___
after that
in my .cpp file i wrote the body of functions.
so where the problem is?
thanks alot
thanks