魔方程序Crash的问题

8 views
Skip to first unread message

Colin.Niu

unread,
Oct 21, 2008, 1:45:01 AM10/21/08
to ck436的讨论组
从网上搜索到这个软件,呵呵,看了说明和截图,感觉正是我要找的东西,迫不及待下载下来却发现不能运行,所以上来求助。

现象:
运行后直接Crash,Debug时的运行栈到这里:
at NmSpcMagicCube.FormMagic.grpMyCubeView_SizeChanged(Object
sender, EventArgs e),空引用。
用Reflector看代码大概猜测错误出现在grpMyCubeView_SizeChanged(object sender,
EventArgs e)的this.pCubeView.Width = this.grpMyCubeView.Width; 处,
pCubeView可能是空的。

运行环境:
Win2003 Server En, .Net Framework3.5.


不知道是怎么回事……


Colin.Niu

unread,
Oct 21, 2008, 1:53:55 AM10/21/08
to ck436的讨论组
栈跟踪:
at NmSpcMagicCube.FormMagic.grpMyCubeView_SizeChanged(Object
sender, EventArgs e)
at System.Windows.Forms.Control.OnSizeChanged(EventArgs e)
at System.Windows.Forms.Control.UpdateBounds(Int32 x, Int32 y,
Int32 width, Int32 height, Int32 clientWidth, Int32 clientHeight)
at System.Windows.Forms.Control.UpdateBounds(Int32 x, Int32 y,
Int32 width, Int32 height)
at System.Windows.Forms.Control.SetBoundsCore(Int32 x, Int32 y,
Int32 width, Int32 height, BoundsSpecified specified)
at System.Windows.Forms.Control.ScaleControl(SizeF factor,
BoundsSpecified specified)
at System.Windows.Forms.GroupBox.ScaleControl(SizeF factor,
BoundsSpecified specified)
at System.Windows.Forms.Control.ScaleControl(SizeF includedFactor,
SizeF excludedFactor, Control requestingControl)
at System.Windows.Forms.Control.Scale(SizeF includedFactor, SizeF
excludedFactor, Control requestingControl)
at System.Windows.Forms.Control.ScaleChildControls(SizeF
includedFactor, SizeF excludedFactor, Control requestingControl)
at System.Windows.Forms.ContainerControl.Scale(SizeF
includedFactor, SizeF excludedFactor, Control requestingControl)
at System.Windows.Forms.ContainerControl.PerformAutoScale(Boolean
includedBounds, Boolean excludedBounds)
at
System.Windows.Forms.ContainerControl.PerformNeededAutoScaleOnLayout()
at System.Windows.Forms.ContainerControl.OnLayoutResuming(Boolean
performLayout)
at System.Windows.Forms.Control.ResumeLayout(Boolean performLayout)
at NmSpcMagicCube.FormMagic.InitializeComponent()
at NmSpcMagicCube.FormMagic..ctor()
at NmSpcMagicCube.Program.Main()

猜测是FormMagic在pCubeView初始化完成之前被调用了SizeChanged(),导致了空引用。

管理员

unread,
Oct 22, 2008, 1:01:49 AM10/22/08
to ck436的讨论组
问题已经解决,但该问题不常见,所以不打算发布新版本,
遇到该问题的可以给我发邮件索取修正过的程序/
ck...@126.com
Reply all
Reply to author
Forward
0 new messages