WinProc2需要WinProc1的信息吗? [英] WinProc2 needs info from WinProc1?

查看:103
本文介绍了WinProc2需要WinProc1的信息吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好

您有"winProc1()",而在"WinProc1()"中有您声明并创建一个指向对象的指针.让我们将此对象称为"A".来自称为"TheA"的类.因此,现在我们有了一个指向名为"A"的对象的指针.类型为"TheA"的在WinProc1()"中.  "TheA"有一个叫 "xxx".

You have "winProc1()", and in "WinProc1()" you declare and create a pointer to an object. Lets call this object "A" from class called "TheA". So now we have a pointer to an object called "A" of type "TheA" in WinProc1()".  "TheA" has a member called "xxx".

在winProc1()"中的某个时刻,我们将"WinProc1()"留在只能获取"WinProc2()"但不会破坏"WinProc1()".因此,我们暂时不再使用"WinPro2()"来自"WinProc1()".

At some point while in winProc1()",  we leave "WinProc1()" only to go fetch "WinProc2()" but not destroying "WinProc1()". So we are temporarily going out of  "WinPro2()" from "WinProc1()".

在"WinProc2()"中,出于某些原因,我们需要使用"xxx"值.

In "WinProc2()" for some reason we need the value of "xxx".

我正在通过指向"A"指针来解决这个问题.在"TheA"中是全球性的这样我就可以使用它来获取"xxx"值而在"winProc2()"中.

I am getting around this by making a pointer to "A" as global in "TheA" sothat I would be able to use it to fetch the value of "xxx" while in "winProc2()".

这是怎么回事...我在这里违反所有规则吗!!!!!!

What's up with this... am I breaking all rules here!!!!!!

任何见解都非常感谢!

r

推荐答案


在winProc1()"中的某个时刻,我们将"WinProc1()"留在只能获取"WinProc2()"但不会破坏"WinProc1()".因此,我们暂时不再使用"WinPro2()"来自"WinProc1()".


At some point while in winProc1()",  we leave "WinProc1()" only to go fetch "WinProc2()" but not destroying "WinProc1()". So we are temporarily going out of  "WinPro2()" from "WinProc1()".

你到底在说什么?函数和子例程未被销毁".您的术语完全不合时宜.

What on earth are you talking about? Functions and subroutines are not "destroyed". Your terminology is completely out of whack.

在"WinProc2()"中,出于某种出于上帝的缘故(我显然碰到了……当然这些东西一直都在找我!)我们需要的值为"xxx".

In "WinProc2()" for some god saken reason (which I obviously ran into... ofcourse these things find me all the time!)  we need the value of "xxx".

我正在通过指向"A"指针来解决这个问题.在"TheA"中是全球性的这样我就可以使用它来获取"xxx"值而在"winProc2()"中.

I am getting around this by making a pointer to "A" as global in "TheA" sothat I would be able to use it to fetch the value of "xxx" while in "winProc2()".

如果WinProc2()过程需要访问A对象,则适当的设计决策将是将此参数作为参数传递,而不使用全局变量.

If the WinProc2() procedure needs to access the A object, then the appropriate design decision would be to pass this as a parameter, not using a global variable.


这篇关于WinProc2需要WinProc1的信息吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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