当我为控件设置location属性时,堆栈溢出 [英] When I set the location property for a control, stack overflows

查看:50
本文介绍了当我为控件设置location属性时,堆栈溢出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Control派生类。当控件的父级更改

控件的位置属性时,堆栈溢出。我还没有找到一种方法来获取
当它溢出时找出堆栈上的内容。我所知道的是

程序由于Main结束时的异常而停止,或者在Stack Overflow异常后退出
。 (这两种情况都是在调试器中运行的Debug版本

。)经过大量的试验和错误(主要是后者带来了一些混乱)抛出我的最后一句话,我终于跟踪了我执行的最后一句话

,如上所述,父母设置了孩子的位置。

属性的位置未被覆盖。我没有订阅孩子'

LocationChanged事件。


我尝试完全重建以防可执行文件损坏。我尝试重新启动

,以防Windows成为原因。没有帮助。


有什么想法吗?

----------

Will Pittenger

电子邮件:mailto:will.pittenger1 at gmail.com

所有邮件由Qurb过滤( www.qurb.com

I have a Control derived class. When the parent of the control changes the
control''s Location property, the stack overflows. I have not found a way to
find out what was on the stack when it does overflow. All I know is that
the program is either stopped due to an exception at the end of Main or has
exited after the Stack Overflow exception. (Both cases are Debug builds
running in the debugger.)

After a lot of trial and error (mostly the latter with a dose of confusion
thrown in), I finally tracked the last statement of mine executed to a line
where, as mentioned, the parent sets the child''s location. The location
property is not overridden. I have not subscribed to the child''s
LocationChanged event.

I tried full rebuilds in case the executable was corrupt. I tried rebooting
in case Windows was the cause. Neither helped.

Any ideas?
----------
Will Pittenger
E-Mail: mailto:will.pittenger1 at gmail.com
All mail filtered by Qurb (www.qurb.com)

推荐答案

您可以发布自定义控件的完整源代码,以及

用于实例化控件并将其添加到

容器的代码,所以我们可以看一下它?


-

Tim Wilson

..Net Compact Framework MVP


" Will Pittenger" < SE *********** @ see.signature.net>在消息中写道

news:或************** @ TK2MSFTNGP09.phx.gbl ...
Can you post the complete source code for your custom control, as well as
the code that''s being used to instantiate the control and add it to the
container, so we can take a look at it?

--
Tim Wilson
..Net Compact Framework MVP

"Will Pittenger" <se***********@see.signature.net> wrote in message
news:Or**************@TK2MSFTNGP09.phx.gbl...
我有一个Control派生的类。当控件的父级更改
控件的位置属性时,堆栈溢出。我没有找到
的方法来找出堆栈溢出时的内容。我所知道的是,程序由于Main结束时的异常而停止,或者在Stack Overflow异常之后退出
。 (这两种情况都是在调试器中运行的Debug版本。)经过大量的试验和错误(大多数是后者带来了一剂混乱),我终于跟踪我执行的最后一个声明到
行,如上所述,父母设置了孩子的位置。位置
属性未被覆盖。我没有订阅孩子的
LocationChanged事件。

我尝试完全重建以防可执行文件损坏。我试过
重新启动,以防Windows成为原因。没有帮助。

任何想法?
----------
Will Pittenger
电子邮件:mailto:will.pittenger1 at gmail。 com
Qurb过滤的所有邮件( www.qurb.com
I have a Control derived class. When the parent of the control changes the control''s Location property, the stack overflows. I have not found a way to find out what was on the stack when it does overflow. All I know is that
the program is either stopped due to an exception at the end of Main or has exited after the Stack Overflow exception. (Both cases are Debug builds
running in the debugger.)

After a lot of trial and error (mostly the latter with a dose of confusion
thrown in), I finally tracked the last statement of mine executed to a line where, as mentioned, the parent sets the child''s location. The location
property is not overridden. I have not subscribed to the child''s
LocationChanged event.

I tried full rebuilds in case the executable was corrupt. I tried rebooting in case Windows was the cause. Neither helped.

Any ideas?
----------
Will Pittenger
E-Mail: mailto:will.pittenger1 at gmail.com
All mail filtered by Qurb (www.qurb.com)





Will Pittenger写道:

Will Pittenger wrote:
我有一个Control派生类。当控件的父级更改
控件的Location属性时,堆栈溢出。我还没有找到一种方法来查看堆栈溢出时堆栈上的内容。我所知道的是,程序要么由于Main结束时的异常而停止,要么在Stack Overflow异常后退出。 (这两种情况都是在调试器中运行的Debug版本。)经过大量的试验和错误(大多数是后者带来了一剂混乱),我终于跟踪我执行的最后一句话到一条线
如上所述,父母设置孩子的位置。位置
属性未被覆盖。我没有订阅孩子的
LocationChanged事件。

我尝试完全重建以防可执行文件损坏。我尝试重新启动
以防Windows成为原因。没有帮助。


您是否在孩子的大小或位置变化中有处理程序?如果你做了b $ b,并且不检查它是否与它相同,你将会b / b
引起无限循环....


找到这些的最简单方法是在处理程序中设置一个断点并且

看看它是如何到达的,或者使用调试工具打印出来

你在这些方法中。

马特
任何想法?
----------
Will Pittenger 电子邮件:mailto:will.pittenger1 at gmail.com
所有邮件由Qurb过滤( www.qurb.com
I have a Control derived class. When the parent of the control changes the
control''s Location property, the stack overflows. I have not found a way to
find out what was on the stack when it does overflow. All I know is that
the program is either stopped due to an exception at the end of Main or has
exited after the Stack Overflow exception. (Both cases are Debug builds
running in the debugger.)

After a lot of trial and error (mostly the latter with a dose of confusion
thrown in), I finally tracked the last statement of mine executed to a line
where, as mentioned, the parent sets the child''s location. The location
property is not overridden. I have not subscribed to the child''s
LocationChanged event.

I tried full rebuilds in case the executable was corrupt. I tried rebooting
in case Windows was the cause. Neither helped.
Do you have a handler in the child for size or location changing? If
you do, and don''t check to see if its the same as it was, you will
cause an infinite loop....

The easiest way to find these is to set a breakpoint in a handler and
see how it got there, or to use the debugging facilities to print out
where you are in the methods.
Matt
Any ideas?
----------
Will Pittenger
E-Mail: mailto:will.pittenger1 at gmail.com
All mail filtered by Qurb (www.qurb.com)






不是位置。大小,是的,但我检查了所有这些。事实上,我不知道

这是以后的位置。除了设置它之外,什么都不应该处理

位置。

----------

Will Pittenger

电子邮件:mailto:will.pittenger1 at gmail.com

所有邮件由Qurb过滤( www.qurb.com


" Matt" <毫安******** @ sprynet.com>在消息中写道

news:11 ********************** @ f14g2000cwb.googlegr oups.com ...
Not location. Size, yes, but I checked all that. In fact, I did not know
it was the location until later. Nothing should be dealing with the
location except to set it.
----------
Will Pittenger
E-Mail: mailto:will.pittenger1 at gmail.com
All mail filtered by Qurb (www.qurb.com)

"Matt" <ma********@sprynet.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...

Will Pittenger写道:

Will Pittenger wrote:
我有一个Control派生类。当控件的父级更改
控件的Location属性时,堆栈溢出。我没有找到一种方法
来查看堆栈溢出时堆栈上的内容。我所知道的是,程序要么由于Main结束时的异常而停止,要么在Stack Overflow异常后退出
。 (这两种情况都是在调试器中运行的Debug版本。)

经过大量的试验和错误(大多数后者都有一定的混乱
投入),我终于跟踪了我执行的最后一个声明到了
线路,如上所述,父母设置了孩子的位置。位置
属性未被覆盖。我没有订阅孩子的
LocationChanged事件。

我尝试完全重建以防可执行文件损坏。我尝试重新启动
以防Windows成为原因。既没有帮助。
I have a Control derived class. When the parent of the control changes
the
control''s Location property, the stack overflows. I have not found a way
to
find out what was on the stack when it does overflow. All I know is that
the program is either stopped due to an exception at the end of Main or
has
exited after the Stack Overflow exception. (Both cases are Debug builds
running in the debugger.)

After a lot of trial and error (mostly the latter with a dose of
confusion
thrown in), I finally tracked the last statement of mine executed to a
line
where, as mentioned, the parent sets the child''s location. The location
property is not overridden. I have not subscribed to the child''s
LocationChanged event.

I tried full rebuilds in case the executable was corrupt. I tried
rebooting
in case Windows was the cause. Neither helped.



您是否在孩子的大小或位置变化中有一个处理程序?如果你这样做,并且不检查它是否与它相同,你将会导致无限循环....

最简单的方法找到这些是在处理程序中设置一个断点,并看看它是如何到达那里的,或者使用调试工具打印出你在方法中的位置。

Matt



Do you have a handler in the child for size or location changing? If
you do, and don''t check to see if its the same as it was, you will
cause an infinite loop....

The easiest way to find these is to set a breakpoint in a handler and
see how it got there, or to use the debugging facilities to print out
where you are in the methods.
Matt


任何想法?
----------
Will Pittenger
电子邮件:mailto:will.pittenger1 at gmail .com所有过滤的邮件( www.qurb.com



这篇关于当我为控件设置location属性时,堆栈溢出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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