我使用GetOpenFilename来获取一些文件名
const int BUFFER_SIZE = 8192;
char* filenames = new char[BUFFER_SIZE];
filenames[0] = 0;
OPENFILENAME ofn;
ZeroMemory(&ofn, sizeof(ofn));
ofn.lStructSize = sizeof(ofn);
ofn.hwndOwner = ::GetActiveWindow();
ofn.lpstrFile = filenames;
ofn.nMaxFile = BUFFER_SIZE;
ofn.lpstrFilter =
"Quotes\0*.json\0"
"All\0*.*\0";
ofn.lpstrCustomFilter = NULL;
ofn.nMaxCustFilter = 0;
ofn.nFilterIndex = 1;
ofn.lpstrFileTitle = NULL;
ofn.nMaxFileTitle = 0;
ofn.lpstrTitle = "Web File Import";
ofn.lpstrInitialDir = "T:\\WebPending";
ofn.Flags = OFN_ENABLESIZING | OFN_ALLOWMULTISELECT | OFN_EXPLORER | OFN_FILEMUSTEXIST | OFN_HIDEREADONLY | OFN_PATHMUSTEXIST | OFN_ENABLEHOOK;
ofn.lpstrDefExt = "json";
ofn.lpfnHook = DDWebImport::Hook;
bool rv = ::GetOpenFileName(&ofn);
// Check the error if you have copied this code to another dialog and it returns immediately without popping up a form
DWORD err = CommDlgExtendedError();
我使用带有SSD的核心i7,这需要8秒钟才能显示文件。当我查看调试输出窗口时,
'xxx.exe': Loaded 'C:\Windows\SysWOW64\propsys.dll', Symbols loaded (source information stripped).
'xxx.exe': Loaded 'C:\Program Files (x86)\Common Files\Microsoft Shared\Ink\tiptsf.dll', Symbols loaded (source information stripped).
'xxx.exe': Loaded 'C:\Windows\SysWOW64\edputil.dll', Symbols loaded (source information stripped).
'xxx.exe': Loaded 'C:\Windows\SysWOW64\policymanager.dll', Symbols loaded (source information stripped).
'xxx.exe': Loaded 'C:\Windows\SysWOW64\msvcp110_win.dll', Symbols loaded (source information stripped).
shell\comdlg32\fileopensave.cpp(9456)\COMDLG32.dll!76290750: (caller: 76283458) ReturnHr[PreRelease](1) tid(1664) 80070490 Element not found.
CallContext:[\PickerModalLoop\InitDialog\FileDialogInitEnterpriseData]
'xxx.exe': Loaded 'C:\Windows\SysWOW64\WindowsCodecs.dll', Symbols loaded (source information stripped).
'xxx.exe': Loaded 'C:\Windows\SysWOW64\thumbcache.dll', Symbols loaded (source information stripped).
'xxx.exe': Loaded 'C:\Windows\SysWOW64\ntshrui.dll', Symbols loaded (source information stripped).
'xxx.exe': Loaded 'C:\Windows\SysWOW64\srvcli.dll', Symbols loaded (source information stripped).
'xxx.exe': Loaded 'C:\Windows\SysWOW64\cscapi.dll', Symbols loaded (source information stripped).
'xxx.exe': Loaded 'C:\Windows\SysWOW64\StructuredQuery.dll', Symbols loaded (source information stripped).
'xxx.exe': Loaded 'C:\Windows\SysWOW64\actxprxy.dll', Symbols loaded (source information stripped).
'xxx.exe': Loaded 'C:\Windows\SysWOW64\Windows.Storage.Search.dll', Symbols loaded (source information stripped).
'xxx.exe': Loaded 'C:\Windows\SysWOW64\DataExchange.dll', Symbols loaded (source information stripped).
'xxx.exe': Loaded 'C:\Windows\SysWOW64\dcomp.dll', Symbols loaded (source information stripped).
'xxx.exe': Loaded 'C:\Windows\SysWOW64\d3d11.dll', Symbols loaded (source information stripped).
'xxx.exe': Loaded 'C:\Windows\SysWOW64\dxgi.dll', Symbols loaded (source information stripped).
'xxx.exe': Loaded 'C:\Windows\SysWOW64\twinapi.appcore.dll', Symbols loaded (source information stripped).
'xxx.exe': Loaded 'C:\Windows\SysWOW64\apphelp.dll', Symbols loaded (source information stripped).
'xxx.exe': Loaded 'C:\Program Files (x86)\Common Files\TortoiseOverlays\TortoiseOverlays.dll', Cannot find or open the PDB file.
'xxx.exe': Loaded 'C:\Program Files\TortoiseGit\bin\TortoiseGitStub32.dll', Cannot find or open the PDB file.
'xxx.exe': Loaded 'C:\Program Files\TortoiseGit\bin\TortoiseGit32.dll', Cannot find or open the PDB file.
'xxx.exe': Loaded 'C:\Windows\SysWOW64\msvcp120.dll', Symbols loaded.
'xxx.exe': Loaded 'C:\Program Files\TortoiseGit\bin\gitdll32.dll', Cannot find or open the PDB file.
'xxx.exe': Loaded 'C:\Program Files\TortoiseGit\bin\libgit232_tgit.dll', Cannot find or open the PDB file.
'xxx.exe': Loaded 'C:\Windows\SysWOW64\msvcr120.dll', Symbols loaded.
'xxx.exe': Loaded 'C:\Program Files\TortoiseGit\bin\zlib132_tgit.dll', Cannot find or open the PDB file.
'xxx.exe': Loaded 'C:\Users\cup\AppData\Local\Microsoft\OneDrive\17.3.6302.0225_1\FileSyncShell.dll', Cannot find or open the PDB file.
'xxx.exe': Loaded 'C:\Windows\SysWOW64\wininet.dll', Symbols loaded (source information stripped).
'xxx.exe': Loaded 'C:\Users\cup\AppData\Local\Microsoft\OneDrive\17.3.6302.0225_1\Telemetry.dll', Cannot find or open the PDB file.
'xxx.exe': Loaded 'C:\Windows\SysWOW64\psapi.dll', Symbols loaded (source information stripped).
'xxx.exe': Loaded 'C:\Users\cup\AppData\Local\Microsoft\OneDrive\17.3.6302.0225_1\LoggingPlatform.dll', Cannot find or open the PDB file.
'xxx.exe': Loaded 'C:\Windows\SysWOW64\cabinet.dll', Symbols loaded (source information stripped).
'xxx.exe': Loaded 'C:\Windows\SysWOW64\wsock32.dll', Symbols loaded (source information stripped).
'xxx.exe': Loaded 'C:\Windows\SysWOW64\mssprxy.dll', Symbols loaded (source information stripped).
'xxx.exe': Loaded 'C:\Program Files (x86)\Microsoft Office\root\Office16\GROOVEEX.DLL', Cannot find or open the PDB file.
'xxx.exe': Loaded 'C:\Windows\SysWOW64\msvcp140.dll', Symbols loaded.
'xxx.exe': Loaded 'C:\Windows\SysWOW64\ucrtbase.dll', Symbols loaded (source information stripped).
'xxx.exe': Loaded 'C:\Windows\SysWOW64\vcruntime140.dll', Symbols loaded.
'xxx.exe': Loaded 'C:\Windows\SysWOW64\msi.dll', Symbols loaded (source information stripped).
'xxx.exe': Loaded 'C:\Program Files (x86)\Microsoft Office\root\Office16\1033\GrooveIntlResource.dll', Binary was not built with debug information
如何阻止GetOpenFilename加载DLL,如directx,git,tortoise git,groove,onedrive。有这么多,他们需要很长时间的加载,并不需要查看一堆文件名。
答案 0 :(得分:0)
我正在寻找的真正答案是Slow loading of symbols during call to CoCreateInstance in VS 2012
基本上在工具/选项/调试/符号中排除加载dll 查找所有说无法找到或打开pdb文件的dll并将其添加到列表中