afxwin.h : precompiled header skipped

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include"afxwin.h"
#include"stdafx.h"

class myframe :public CFrameWnd
{
public:
	myframe()
	{
		Create(0, "YO!! IT'S PG HERE B-)");
	}
};

class myapp :public CWinApp
{
	int InitInstance()
	{
		myframe *p;
		p = new myframe;
		p->ShowWindow(3);
		m_pMainWnd = p;
		return 1;
	}
};
myapp a;


Why do I get the error
'#include "afxwin.h"': skipped when looking for precompiled header use
You are using precompiled headers -- so your precompiled header must be your very first #include.

The PCH in this case is stdafx.h. So move that to the top of your file (switch lines 1 and 2)
Topic archived. No new replies allowed.