IFileDialog2未在W7上注册 [英] IFileDialog2 not registered on W7
本文介绍了IFileDialog2未在W7上注册的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试在Windows 7上使用IFileDialog2对象.
I am trying to use the IFileDialog2 object on Windows 7
#include <shobjidl.h>
...
CComPtr<IFileDialog2> FileDialog2Ptr;
HRESULT hr = FileDialog2Ptr.CoCreateInstance(__uuidof(IFileDialog2));
结果hr
为"0x80040154 Class not registered
".
根据 MSDN [
The result hr
is "0x80040154 Class not registered
".
According to MSDN[^] IFileDialog2
requires Windows 7 and ComDlg32.dll version 6.1 or later. I am running Windows 7 Home Edition with ComDlg32.dll version 6.1.7601.17514.
I am using VS2005 Team Suite SP1 with the Platform SDK version 7.0
How can I fix this error?
推荐答案
您正试图从无效的类工厂创建接口
you''re trying to create the interface from an invalid class factory
HRESULT hr = FileDialog2Ptr.CoCreateInstance(__uuidof(IFileDialog2));
应该是CLSID_FileOpenDialog
?
在此处查看常用项目对话框 [
That should be CLSID_FileOpenDialog
?
Have a look here Common Item Dialog[^]
这篇关于IFileDialog2未在W7上注册的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文