CFileDialog的DoModal填充调试窗口

时间:2018-11-11 22:20:09

标签: c++ winapi mfc

CStringW strFilter;
strFilter.LoadStringW(IDS_IMGFILEFILTER);
//Image Files (*.bmp;*.gif;*.jpg;*.png;*.tif)*.bmp;*.gif;*.jpg;*.png;*.tif|All Files (*.*)|*.*||

CFileDialog dlgFile(TRUE, NULL, NULL, OFN_ALLOWMULTISELECT |
    OFN_DONTADDTORECENT | OFN_FILEMUSTEXIST, strFilter, AfxGetMainWnd());
if (dlgFile.DoModal() != IDOK) return;

使用Windows 10(64位)

在调用DoModal之后,与对话框进行任何交互之前,错误会立即出现。

输出窗口:

mincore\com\oleaut32\dispatch\ups.cpp(2125)\OLEAUT32.dll!00007FF9F66E2CA6: (caller: 00007FF9F66E2DCA) ReturnHr(1) tid(2cac) 8002801D Library not registered.
The thread 0x27b4 has exited with code 0 (0x0).
Exception thrown at 0x00007FF9F503A388 (KernelBase.dll) in ProgramName.exe: 0x000006BA: The RPC server is unavailable.
onecoreuap\shell\windows.storage\homefolder.cpp(506)\windows.storage.dll!00007FF9F48A2884: (caller: 00007FF9F47CB563) ReturnHr(1) tid(3b00) 80070490 Element not found.
onecoreuap\shell\windows.storage\regfldr.cpp(1242)\windows.storage.dll!00007FF9F489F30D: (caller: 00007FF9F47C83E8) ReturnHr(2) tid(3b00) 80070490 Element not found.
onecoreuap\shell\windows.storage\homefolder.cpp(506)\windows.storage.dll!00007FF9F48A2884: (caller: 00007FF9F47CB563) ReturnHr(3) tid(3b00) 80070490 Element not found.
onecoreuap\shell\windows.storage\regfldr.cpp(1242)\windows.storage.dll!00007FF9F489F30D: (caller: 00007FF9F47C83E8) ReturnHr(4) tid(3b00) 80070490 Element not found.
onecoreuap\shell\windows.storage\homefolder.cpp(506)\windows.storage.dll!00007FF9F48A2884: (caller: 00007FF9F47CB563) ReturnHr(5) tid(2cac) 80070490 Element not found.
onecoreuap\shell\windows.storage\regfldr.cpp(1242)\windows.storage.dll!00007FF9F489F30D: (caller: 00007FF9F47C83E8) ReturnHr(6) tid(2cac) 80070490 Element not found.
shell\shell32\ovrlaymn.cpp(676)\SHELL32.dll!00007FF9F6BA3824: (caller: 00007FF9F6BA3604) ReturnHr(1) tid(2f64) 80040154 Class not registered
shell\shell32\ovrlaymn.cpp(758)\SHELL32.dll!00007FF9F6BA3653: (caller: 00007FF9F6BA34DE) LogHr(1) tid(2f64) 80040154 Class not registered
Msg:[Creating icon overlay handler from 敒楧瑳祲 failed. The CLSID is {BBACC218-34EA-4666-9D7A-C78F2274A524}.] 
shell\shell32\ovrlaymn.cpp(676)\SHELL32.dll!00007FF9F6BA3824: (caller: 00007FF9F6BA3604) ReturnHr(2) tid(2f64) 80040154 Class not registered
shell\shell32\ovrlaymn.cpp(758)\SHELL32.dll!00007FF9F6BA3653: (caller: 00007FF9F6BA34DE) LogHr(2) tid(2f64) 80040154 Class not registered
Msg:[Creating icon overlay handler from 敒楧瑳祲 failed. The CLSID is {5AB7172C-9C11-405C-8DD5-AF20F3606282}.] 
shell\shell32\ovrlaymn.cpp(676)\SHELL32.dll!00007FF9F6BA3824: (caller: 00007FF9F6BA3604) ReturnHr(3) tid(2f64) 80040154 Class not registered
shell\shell32\ovrlaymn.cpp(758)\SHELL32.dll!00007FF9F6BA3653: (caller: 00007FF9F6BA34DE) LogHr(3) tid(2f64) 80040154 Class not registered
Msg:[Creating icon overlay handler from 敒楧瑳祲 failed. The CLSID is {A78ED123-AB77-406B-9962-2A5D9D2F7F30}.] 
shell\shell32\ovrlaymn.cpp(676)\SHELL32.dll!00007FF9F6BA3824: (caller: 00007FF9F6BA3604) ReturnHr(4) tid(2f64) 80040154 Class not registered
shell\shell32\ovrlaymn.cpp(758)\SHELL32.dll!00007FF9F6BA3653: (caller: 00007FF9F6BA34DE) LogHr(4) tid(2f64) 80040154 Class not registered
Msg:[Creating icon overlay handler from 敒楧瑳祲 failed. The CLSID is {F241C880-6982-4CE5-8CF7-7085BA96DA5A}.] 
shell\shell32\ovrlaymn.cpp(676)\SHELL32.dll!00007FF9F6BA3824: (caller: 00007FF9F6BA3604) ReturnHr(5) tid(2f64) 80040154 Class not registered
shell\shell32\ovrlaymn.cpp(758)\SHELL32.dll!00007FF9F6BA3653: (caller: 00007FF9F6BA34DE) LogHr(5) tid(2f64) 80040154 Class not registered
Msg:[Creating icon overlay handler from 敒楧瑳祲 failed. The CLSID is {A0396A93-DC06-4AEF-BEE9-95FFCCAEF20E}.] 
shell\shell32\ovrlaymn.cpp(676)\SHELL32.dll!00007FF9F6BA3824: (caller: 00007FF9F6BA3604) ReturnHr(6) tid(2f64) 80040154 Class not registered
shell\shell32\ovrlaymn.cpp(758)\SHELL32.dll!00007FF9F6BA3653: (caller: 00007FF9F6BA34DE) LogHr(6) tid(2f64) 80040154 Class not registered
Msg:[Creating icon overlay handler from 敒楧瑳祲 failed. The CLSID is {9AA2F32D-362A-42D9-9328-24A483E2CCC3}.] 
shell\shell32\ovrlaymn.cpp(676)\SHELL32.dll!00007FF9F6BA3824: (caller: 00007FF9F6BA3604) ReturnHr(7) tid(2f64) 80040154 Class not registered
shell\shell32\ovrlaymn.cpp(758)\SHELL32.dll!00007FF9F6BA3653: (caller: 00007FF9F6BA34DE) LogHr(7) tid(2f64) 80040154 Class not registered
Msg:[Creating icon overlay handler from 敒楧瑳祲 failed. The CLSID is {C5FF006E-2AE9-408C-B85B-2DFDD5449D9C}.] 

但是,看不到程序执行有任何问题。

还尝试了bVistaStyle = FALSE并复制了文件名缓冲区代码,如下所示 https://docs.microsoft.com/en-us/cpp/mfc/reference/cfiledialog-class?view=vs-2017

仍然充满错误消息的页面。

文件共享已被有意禁用。 “ RPC服务器不可用”的可能原因?

以前在默认设置中已经看到“ OLEAUT32.dll库未注册”消息 为Win32桌面应用程序创建的框架VS,但是消息消失了 更新之前。从来没有造成任何问题。

对“ windows.storage”一无所知,但似乎可以访问已知文件夹 例如“桌面”,“文档”等。访问这些文件夹没有问题。

我最大的担心是那些中国人(或任何外语) 流程肯定看起来像是某种腐败。

创建自己的文件名缓冲区似乎是不必要的,因为没有它,它可以完美地工作 在Microsoft的示例中绕过了“ GetStartPosition”和“ GetNextPathName”。 是否已更新?

0 个答案:

没有答案