无法引用 IID_ICorProfilerInfo

发布于 2024-11-29 16:36:16 字数 562 浏览 4 评论 0原文

我正在尝试使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

吃不饱 2024-12-06 16:36:16

您可能缺少与 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 as extern). In the sample you mention, see Building the Source Code.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文