在VS 2012中调用CoCreateInstance期间缓慢加载符号 [英] Slow loading of symbols during call to CoCreateInstance in VS 2012

查看:262
本文介绍了在VS 2012中调用CoCreateInstance期间缓慢加载符号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的MFC项目中,有时会调用CoCreateInstance:

In my MFC project I call CoCreateInstance at some point:

if ( SUCCEEDED( CoCreateInstance ( CLSID_DragDropHelper, NULL,
                                   CLSCTX_INPROC_SERVER,
                                   IID_IDropTargetHelper,
                                  (void**) &m_piDropHelper ) ))
{
   ...
}

,等到DragDropHelper完成后,我叫Release:

m_piDropHelper->Release();

到目前为止,一切正常.

So far so good, everything works fine.

但是在调试过程中,第一次调用此CoCreateInstance的过程非常缓慢,因为VS正在加载大量符号(此加载在VS Output窗口中可见,请参见下文).随后对同一CoCreateInstance的调用很快.但是,当我重新启动调试程序时,第一次调用此CoCreateInstance的速度再次变慢.

But during debug the very first call to this CoCreateInstance is painfully slow because VS is loading tons of symbols (this loading is visible in the VS Output window, see below). Subsequent calls to the same CoCreateInstance are fast. But when I restart de debugee, the first call to this CoCreateInstance is slow again.

我不需要这些符号.

有没有一种方法可以防止Visual Studio加载所有这些符号.

Is there a way to prevent Visual Studio from loading all these symbols.

调试过程中输出窗口的部分内容

'MyProg.exe': Loaded 'C:\Windows\SysWOW64\WindowsCodecs.dll', Symbols loaded (source information stripped).
'MyProg.exe': Loaded 'C:\Windows\SysWOW64\apphelp.dll', Symbols loaded (source information stripped).
'MyProg.exe': Loaded 'C:\Program Files (x86)\Common Files\TortoiseOverlays\TortoiseOverlays.dll', Cannot find or open the PDB file.
'MyProg.exe': Loaded 'C:\Program Files\TortoiseGit\bin\TortoiseGitStub32.dll', Cannot find or open the PDB file.
'MyProg.exe': Loaded 'C:\Program Files\TortoiseGit\bin\TortoiseGit32.dll', Cannot find or open the PDB file.
'MyProg.exe': Loaded 'C:\Program Files\TortoiseGit\bin\libgit232_tgit.dll', Cannot find or open the PDB file.
'MyProg.exe': Loaded 'C:\Program Files\TortoiseGit\bin\zlib132_tgit.dll', Cannot find or open the PDB file.
'MyProg.exe': Loaded 'C:\Windows\SysWOW64\msvcr120.dll', Symbols loaded.
'MyProg.exe': Loaded 'C:\Windows\SysWOW64\ws2_32.dll', Symbols loaded (source information stripped).
   <30 more similar lines>
'MyProg.exe': Unloaded 'C:\Program Files (x86)\Microsoft Office\Office14\GROOVEEX.DLL'
'MyProg.exe': Loaded 'C:\Program Files (x86)\Microsoft Office\Office14\GROOVEEX.DLL', Cannot find or open the PDB file.
'MyProg.exe': Loaded 'C:\Windows\winsxs\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.6161_none_50934f2ebcb7eb57\msvcr90.dll', Symbols loaded (source information stripped).
'MyProg.exe': Loaded 'C:\Windows\winsxs\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.6161_none_50934f2ebcb7eb57\msvcp90.dll', Symbols loaded (source information stripped).
'MyProg.exe': Loaded 'C:\Windows\winsxs\x86_microsoft.vc90.atl_1fc8b3b9a1e18e3b_9.0.30729.6161_none_51cd0a7abbe4e19b\ATL90.dll', Symbols loaded (source information stripped).
'MyProg.exe': Loaded 'C:\Program Files (x86)\Common Files\microsoft shared\OFFICE14\Cultures\OFFICE.ODF', Cannot find or open the PDB file.
'MyProg.exe': Loaded 'C:\Program Files (x86)\Microsoft Office\Office14\1036\GrooveIntlResource.dll', Cannot find or open the PDB file.
'MyProg.exe': Loaded 'C:\Windows\SysWOW64\RpcRtRemote.dll', Symbols loaded (source information stripped).

推荐答案

您可以使用工具/选项/调试/符号来包含/排除符号.

You can include/exclude symbols by using Tools/Options/Debugging/Symbols.

自动为以下项目加载符号"的两个选项应提供所需的内容.

The two options for "Automatically load symbols for:" should provide what you want.

这篇关于在VS 2012中调用CoCreateInstance期间缓慢加载符号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆