如何创建 ICLRAppDomainResourceMonitor 接口的实例?
我正在尝试创建 ICLRAppDomainResourceMonitor 接口的实例,但我发现没有coclass 实现它的线索。如果没有这些知识,我就无法创建 coclass 的对象实例并从 coclass 对象中检索该接口。
有人能帮我解决这个问题吗?非常感谢。
I am trying to create an instance of ICLRAppDomainResourceMonitor interface, but I found no clue of what coclass implements it. Without that knowledge, I cannot create an object instance of the coclass and retrieve that interface from the coclass object.
Could anyone help me on this? Many thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在上面的代码中我们可以成功创建ICLRAppDomainResourceMonitor的实例。
实际上,我正在尝试获取同一系统上运行的每个 .NET 4.0 进程的每个 AppDomain 的属性值。
我尝试使用以下代码来获取 AppDomain 的数据:
}
但 API monitor->GetCurrentAllocation(Aid, &bytes) 将 hr 的返回值设为 -2146234348 ie COR_E_APPDOMAINUNLOADED
请提供您的意见。
谢谢,
In above code we can create instance of ICLRAppDomainResourceMonitor successfully.
Actually I am trying to fetch values of attributes of each AppDomain of each .NET 4.0 processes running on the same system.
I tried following code to fetch data of AppDomain :
}
but API monitor->GetCurrentAllocated(Aid, &bytes) return value of hr as -2146234348 ie COR_E_APPDOMAINUNLOADED
Please provide your comments.
Thanks,
一旦您拥有从 ICLRRuntimeHost::GetCLRControl 生成的 ICLRControl,请使用 IID_ICLRAppDomainResourceMonitor 执行 ICLRControl::GetCLRManager 以获取所需的接口。
例如
编辑:注意,您必须使用 CLR v4.0 才能工作。使用 4.0 元主机和 2.0 运行时是不够的。
Once you have a ICLRControl, generated from ICLRRuntimeHost::GetCLRControl, execute ICLRControl::GetCLRManager using IID_ICLRAppDomainResourceMonitor for the desired interface.
e.g.
Edit: Note, you have to use the CLR v4.0 for the to work. Using the 4.0 metahost and 2.0 runtime isn't enough.