Settings | Sign in | Sign up

The author has 2 posts.

Visual Studio Community 2017/2019 下載方法

Floor 5 巨大八爪鱼 6/8/25 1:15

vs2019 創建mfc出現COM組件的調用返回了錯誤的解決辦法(完美解決)

或者出現:cannot open include file 『afxres.h』(完美解決)問題也可以按一下方式解決:

測試系統:windows 22h2 專業版

下載安裝vs2019微軟開發工具(下載了請繼續完後看),在安裝界面選擇使用c++的桌面開發,再在單個組件里輸入mfc

然後選擇(3個組件,一個不能少,否則創建項目會出現錯誤,這三個打上勾

1、c++v14.20 MFC for v142 生成工具(v142)(x86 和x64)

2、c++v14.20 MFC for v142 生成工具及Spectre緩解(x86 和x64)

3、適用於最新v142生成工具的c++ MFC(x86 和x64)(缺少這個會造成cannot open file 「afxres.h」錯誤),然後會繼續報」對COM組件的調用返回了錯誤HRESULT E_FAIL」

然後安裝就可以了。

安裝好以後打開不vs2019創建項目選擇mfc應用,就可以創建了。

https://blog.csdn.net/weixin_45976545/article/details/134067072

巨大八爪鱼 3/12/26 21:57
最好把「對 VS 2017 (v141)工具的 C++ Windows XP 支持[已棄用]」也勾選上。

Content converter:

Reply the post
Content:
User: You are currently anonymous.
Captcha:
Unclear? Try another one.