閱讀998 返回首頁    go 阿裏雲 go 技術社區[雲棲]


win32程序中簡單應用mfc

今日寫程序在win32中用CRect發現報錯,突然想起來。要引入mfc庫。想重新建立一個工程添加對mfc的支持。發現選項不能選。查資料後發現。

在win32程序中簡單應用mfc庫,隻需要簡單的引入<afx.h>就好了。注意這個時候如果出來

#ifdef _DLL
#ifndef _AFXDLL
#error Building MFC application with /MD[d] (CRT dll version) requires MFC shared dll version. Please #define _AFXDLL or do not use /MD[d]
#endif
#endif

這個錯誤。隻需要把use of mfc改為Use MFC in a Shared DLL就可以了。

當然<windows.h>頭文件在mfc中已經包含所以去掉。

最後更新:2017-04-03 14:53:38

  上一篇:go 線程中CreateEvent和SetEvent及WaitForSingleObject的用法
  下一篇:go 今年-計劃寫一本java方麵的書籍-初稿正式完成