无法引用 IID_ICorProfilerInfo
我正在尝试使用 Profiling API 构建自定义 .NET 分析器,但项目中的引用存在问题。我不是 C++ 工程师,所以请耐心等待。
我在 Visual Studio 2010 的 ATL Server 项目中创建了一个简单的 COM 服务器。一切都构建得很好,直到我添加代码来查询正在提供服务的接口:
HRESULT hr = pICorProfilerInfoUnk->QueryInterface( IID_ICorProfilerInfo,
(void **)&m_pICorProfilerInfo );
在头文件中,我引用了 cor.h 和 corprof.h 头文件,但我遗漏了一些东西。
作为参考,我使用此网站 示例 中的代码作为参考。
任何帮助将不胜感激,我意识到这可能很晦涩。
I am trying to build a custom .NET profiler using the Profiling API and I am having an issue with the references in the project. I am not a C++ engineer, so please bear with me.
I have created a simple COM server in Visual Studio 2010 in an ATL Server project. Everything builds fine, up until I add the code to query the interface that is being served:
HRESULT hr = pICorProfilerInfoUnk->QueryInterface( IID_ICorProfilerInfo,
(void **)&m_pICorProfilerInfo );
In the head file, I am referencing the cor.h and the corprof.h header files, but I am missing something.
As a reference, I am using the code from this site Sample as a reference.
Any assistance would be appreciated and I realize this is probably obscure.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可能缺少与 corguids.lib 的链接,该库包含 IID_ICorProfilerInfo 的实际定义(在 corprof.h 中仅声明为 extern)。在您提到的示例中,请参阅构建源代码。
You're probably missing the linkage to corguids.lib, which holds the actual definition of
IID_ICorProfilerInfo
(in corprof.h it's only declared asextern
). In the sample you mention, see Building the Source Code.