深入淺出MFC 例子執行錯誤

2021-05-27 10:48:49 字數 1157 閱讀 4565

錯誤資訊:

compiling...

mfc.cpp

d:\61\mfc7\mfc.cpp(61) : error c2101: '&' on constant

d:\61\mfc7\mfc.cpp(65) : error c2101: '&' on constant

d:\61\mfc7\mfc.cpp(69) : error c2101: '&' on constant

d:\61\mfc7\mfc.cpp(73) : error c2101: '&' on constant

d:\61\mfc7\mfc.cpp(77) : error c2101: '&' on constant

my.cpp

d:\61\mfc7\my.cpp(18) : error c2101: '&' on constant

d:\61\mfc7\my.cpp(22) : error c2101: '&' on constant

d:\61\mfc7\my.cpp(26) : error c2101: '&' on constant

d:\61\mfc7\my.cpp(30) : error c2101: '&' on constant

d:\61\mfc7\my.cpp(55) : warning c4018: '==' : signed/unsigned mismatch

error executing cl.exe.

mfc7.exe - 9 error(s), 1 warning(s)

錯誤原因:

vc 6、5訊息對映有不同。

1)修改 標頭檔案 afxmsg_.h 中

#define on_command(id, memberfxn) \

,改 cn_command為 0

並且2)

修改 標頭檔案mfc.h中

// message map signature values and macros in separate header

#include 

為// message map signature values and macros in separate header

#include "afxmsg_.h"

rebuild all

深入淺出MFC筆記

深入淺出mfc筆記 一 勿在浮砂築高台 1 並不是擴充套件名為 dll dynamic link library 的才是動態鏈結庫。事實上,exe dll fon mod drv 和.ocx 都是所謂的動態鏈結函式庫。2 windows 程式編譯時需要包含 windows.h 標頭檔案,若需要使用諸...

深入淺出MFC 卷首語

昨晚有點睡不著,想起還有些書還沒看完,於是,起床把 深入淺出mfc 看完了。看這本書斷斷續續也有乙個多月了,我看完之後的第一衝動是找本mfc應用的書來深入熟悉熟悉mfc。因為,看這本書的時候,才發現自己的mfc知識是那麼的貧乏,總有點力不從心的感覺,以至於很多東西都一看而過,根本進入不了思考的階段。...

深入淺出MFC 卷首語

昨晚有點睡不著,想起還有些書還沒看完,於是,起床把 深入淺出mfc 看完了。看這本書斷斷續續也有乙個多月了,我看完之後的第一衝動是找本mfc應用的書來深入熟悉熟悉mfc。因為,看這本書的時候,才發現自己的mfc知識是那麼的貧乏,總有點力不從心的感覺,以至於很多東西都一看而過,根本進入不了思考的階段。...