解决了一个变通方法:这是不可能的。 [英] Solved with a workaround: This is not possible huh.

查看:72
本文介绍了解决了一个变通方法:这是不可能的。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我有一个项目是主机应用程序的com dll插件。

主机应用程序的制造商让我们得到指向各种数据结构的指针

,比如这样的UIContext结构。



Hi,

I have a project that is a com dll plugin to a host application.
The maker of the host application lets us get pointers to various data stucts
such as the UIContext structure like this.

ISonarUIContext3*		m_pSonarUIContext3;





我可以从主机应用程序中获取当前的UI上下文:



From which I can get the current UI Context running in the Host app:

m_pSonarUIContext3->GetUIContextEx( SurfaceIDs[0], &uiContainer );





很酷。



但是我现在需要从钩子过程中检查UI上下文。



所以我尝试使用我的插件类的静态实例和变量一样。



Cool.

But I need to now check the UI context from a hook proc.

So I tried to use a static instance of my plugin class as I do with variables.

StaticCBCRMaster->m_pSonarUIContext3->GetUIContextEx( SurfaceIDs[0], &uiContainer );





哪些编译,但不能链接因为stuct在主机应用程序中是受保护的而不是静态的。



我将无法从钩子proc my I调用GetUIContextEx()。



:Ron



Which compiles, but can't link because the stuct in the host app is protected and not static.

I'm not going to be able to ever call GetUIContextEx() from a hook proc am I.

:Ron

推荐答案

我找到了解决办法:



而不是在钩子proc中做工作,我只是设置一个标志来完成工作,所以当一个75毫秒刷新定时器调用我的代码时,我检查标志并完成我无限制访问该功能的工作。



似乎工作正常 - 需要大量的测试。



很抱歉再次打扰感谢所有回复的人。



:Ron
I found a work around:

Instead of doing the work in the hook proc, I just set a flag to do the work so when a 75 ms refresh timer calls my code I check the flag and do the work where I have unfettered access to the function.

It seems to be working - needs lots of testing.

Sorry to be a bother again and thanks to all who replied.

:Ron


这篇关于解决了一个变通方法:这是不可能的。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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