win32控制台程序使用cstirng类

win32控制台项目中试用mfc,并且还要试用Windows.h。
类文件中
#include <afx.h>

#include <wmsdk.h>

main文件中

#include <stdio.h>
#include <stdlib.h>

#include <iostream>
#include "WmvStream.h"

#include <Windows.h>
using namespace std;


  fatal   error   C1189:   #error   :     WINDOWS.H   already   included.     MFC   apps   must   not   #include   <windows.h>   

配置属性->常规->项目默认值->MFC的试用:在共享 DLL 中使用 MFC

配置属性->C/C++->代码生成->运行时库:多线程调试DLL(/MDd)

配置属性->C/C++->预编译头->创建/使用用预编译头:不使用预编译头

将试用afx的类文件中#include <afx.h>改为#include <afxwin.h>即可。注意main文件中的包含顺序!

猜你喜欢

转载自blog.csdn.net/enlaihe/article/details/80181362