Designer stuck in loop

T

Tom C

We have a window named FormApplication which just happens to be our
mid parent window. When I open it in the designer, it is stuck in a
loop redisplaying a c1flexgrid. maxing out our cpu's. By attaching to
the process from another visual studio, I can get it to break on some
user code with this huge callstack, most of which is native. So are we
instantiating something in design mode that we should not be? Does
this mean anything to anyone? Is there any way to track dow the cause
of this?
AdvancedSoftwareDesigns.Windows.Forms.dll!AdvancedSoftwareDesigns.Windows.Forms.FlexGrid._flex_Paint(Object sender = {ProductVision.Windows.Forms.FlexGrid}, System.Windows.Forms.PaintEventArgs e = {ClipRectangle = {System.Drawing.Rectangle}}) Line 441 Basic
System.Windows.Forms.dll!
System.Windows.Forms.Control.OnPaint(System.Windows.Forms.PaintEventArgs
e) + 0x57 bytes
C1.Win.C1FlexGrid.2.dll!
C1.Win.C1FlexGrid.Util.BaseControls.ScrollableControl.OnPaint(System.Windows.Forms.PaintEventArgs
e = {ClipRectangle = {X=0,Y=223,Width=262,Height=67}}) + 0x36 bytes
C1.Win.C1FlexGrid.2.dll!
C1.Win.C1FlexGrid.C1FlexGridBase.OnPaint(System.Windows.Forms.PaintEventArgs
e = {ClipRectangle = {X=0,Y=223,Width=262,Height=67}}) + 0x35 bytes
System.Windows.Forms.dll!
System.Windows.Forms.Control.PaintWithErrorHandling(System.Windows.Forms.PaintEventArgs
e = {ClipRectangle = {X=0,Y=223,Width=262,Height=67}}, short layer,
bool disposeEventArgs = false) + 0x5b bytes
System.Windows.Forms.dll!System.Windows.Forms.Control.WmPaint(ref
System.Windows.Forms.Message m) + 0x20b bytes
System.Windows.Forms.dll!System.Windows.Forms.Control.WndProc(ref
System.Windows.Forms.Message m) + 0x2e7 bytes
C1.Win.C1FlexGrid.2.dll!
C1.Win.C1FlexGrid.Util.BaseControls.ScrollableControl.WndProc(ref
System.Windows.Forms.Message m = {msg=0xf (WM_PAINT) hwnd=0xd08b6
wparam=0x0 lparam=0x0 result=0x0}) + 0x1ef bytes
System.Windows.Forms.dll!
System.Windows.Forms.Control.ControlNativeWindow.OnMessage(ref
System.Windows.Forms.Message m) + 0xd bytes
System.Design.dll!
System.Windows.Forms.Design.ControlDesigner.DesignerWindowTarget.DefWndProc(ref
System.Windows.Forms.Message m) + 0xb bytes
System.Design.dll!
System.Windows.Forms.Design.ControlDesigner.WndProc(ref
System.Windows.Forms.Message m = {msg=0xf (WM_PAINT) hwnd=0xd08b6
wparam=0x0 lparam=0x0 result=0x0}) + 0xcca bytes
System.Design.dll!
System.Windows.Forms.Design.ControlDesigner.DesignerWindowTarget.OnMessage(ref
System.Windows.Forms.Message m) + 0x46 bytes
System.Windows.Forms.dll!
System.Windows.Forms.Control.ControlNativeWindow.WndProc(ref
System.Windows.Forms.Message m) + 0xd6 bytes
System.Windows.Forms.dll!
System.Windows.Forms.NativeWindow.DebuggableCallback(System.IntPtr
hWnd, int msg = 15, System.IntPtr wparam, System.IntPtr lparam) + 0x75
bytes
[Native to Managed Transition]
[Managed to Native Transition]
System.Windows.Forms.dll!System.Windows.Forms.Control.Update() +
0x6b bytes
System.Design.dll!
System.Windows.Forms.Design.Behavior.BehaviorService.AdornerWindow.InvalidateAdornerWindow(System.Drawing.Region
region) + 0x62 bytes
System.Design.dll!
System.Windows.Forms.Design.ToolStripItemBehavior.ClearInsertionMark(System.Windows.Forms.ToolStripItem
item) + 0x1fd bytes
System.Design.dll!
System.Windows.Forms.Design.ToolStripItemBehavior.OnMouseLeave(System.Windows.Forms.Design.Behavior.Glyph
g) + 0x4d bytes
System.Design.dll!
System.Windows.Forms.Design.Behavior.BehaviorService.InvokeMouseEnterLeave(System.Windows.Forms.Design.Behavior.Glyph
leaveGlyph, System.Windows.Forms.Design.Behavior.Glyph enterGlyph =
{System.Windows.Forms.Design.ToolStripItemGlyph}) + 0x4e bytes
System.Design.dll!
System.Windows.Forms.Design.Behavior.BehaviorService.PropagateHitTest(System.Drawing.Point
pt) + 0xaa bytes
System.Design.dll!
System.Windows.Forms.Design.Behavior.BehaviorService.AdornerWindow.WndProcProxy(ref
System.Windows.Forms.Message m = {msg=0x200 (WM_MOUSEMOVE)
hwnd=0xa0a80 wparam=0x0 lparam=0x2d101d3 result=0x0}, int x, int y) +
0x32 bytes
System.Design.dll!
System.Windows.Forms.Design.Behavior.BehaviorService.AdornerWindow.MouseHook.ProcessMouseMessage(System.IntPtr
hWnd, int msg, int x, int y) + 0x172 bytes
System.Design.dll!
System.Windows.Forms.Design.Behavior.BehaviorService.AdornerWindow.MouseHook.MouseHookProc(int
nCode = 0, System.IntPtr wparam = 512, System.IntPtr lparam = 1241372)
+ 0x5f bytes
[Native to Managed Transition]
System.Windows.Forms.dll!
System.Windows.Forms.NativeWindow.DefWndProc(ref
System.Windows.Forms.Message m = {msg=0x112 (WM_SYSCOMMAND)
hwnd=0xa0a80 wparam=0xf087 lparam=0x116fee9 result=0x0}) + 0x94 bytes
System.Windows.Forms.dll!System.Windows.Forms.Control.DefWndProc(ref
System.Windows.Forms.Message m) + 0xc bytes
System.Windows.Forms.dll!System.Windows.Forms.Control.WndProc(ref
System.Windows.Forms.Message m) + 0x38c bytes
System.Windows.Forms.dll!
System.Windows.Forms.ScrollableControl.WndProc(ref
System.Windows.Forms.Message m) + 0x45 bytes
System.Design.dll!
System.Windows.Forms.Design.DesignerFrame.OverlayControl.WndProc(ref
System.Windows.Forms.Message m = {msg=0x112 (WM_SYSCOMMAND)
hwnd=0xa0a80 wparam=0xf087 lparam=0x116fee9 result=0x0}) + 0x26 bytes
System.Windows.Forms.dll!
System.Windows.Forms.Control.ControlNativeWindow.OnMessage(ref
System.Windows.Forms.Message m) + 0xd bytes
System.Windows.Forms.dll!
System.Windows.Forms.Control.ControlNativeWindow.WndProc(ref
System.Windows.Forms.Message m) + 0xd6 bytes
System.Windows.Forms.dll!
System.Windows.Forms.NativeWindow.DebuggableCallback(System.IntPtr
hWnd, int msg = 274, System.IntPtr wparam, System.IntPtr lparam) +
0x75 bytes
[Native to Managed Transition]
[Managed to Native Transition]
System.Windows.Forms.dll!
System.Windows.Forms.NativeWindow.DefWndProc(ref
System.Windows.Forms.Message m = {msg=0xa1 (WM_NCLBUTTONDOWN)
hwnd=0xa0a80 wparam=0x7 lparam=0x116fee9 result=0x0}) + 0x94 bytes
System.Windows.Forms.dll!System.Windows.Forms.Control.DefWndProc(ref
System.Windows.Forms.Message m) + 0xc bytes
System.Windows.Forms.dll!System.Windows.Forms.Control.WndProc(ref
System.Windows.Forms.Message m) + 0x87a bytes
System.Windows.Forms.dll!
System.Windows.Forms.ScrollableControl.WndProc(ref
System.Windows.Forms.Message m) + 0x45 bytes
System.Design.dll!
System.Windows.Forms.Design.DesignerFrame.OverlayControl.WndProc(ref
System.Windows.Forms.Message m = {msg=0xa1 (WM_NCLBUTTONDOWN)
hwnd=0xa0a80 wparam=0x7 lparam=0x116fee9 result=0x0}) + 0x26 bytes
System.Windows.Forms.dll!
System.Windows.Forms.Control.ControlNativeWindow.OnMessage(ref
System.Windows.Forms.Message m) + 0xd bytes
System.Windows.Forms.dll!
System.Windows.Forms.Control.ControlNativeWindow.WndProc(ref
System.Windows.Forms.Message m) + 0xd6 bytes
System.Windows.Forms.dll!
System.Windows.Forms.NativeWindow.DebuggableCallback(System.IntPtr
hWnd, int msg = 161, System.IntPtr wparam, System.IntPtr lparam) +
0x75 bytes
 
T

Tom C

We have a window named FormApplication which just happens to be our
mid parent window. When I open it in the designer, it is stuck in a
loop redisplaying a c1flexgrid. maxing out our cpu's. By attaching to
the process from another visual studio, I can get it to break on some
user code with this huge callstack, most of which is native. So are we
instantiating something in design mode that we should not be? Does
this mean anything to anyone? Is there any way to track dow the cause
of this?
AdvancedSoftwareDesigns.Windows.Forms.dll!AdvancedSoftwareDesigns.Windows.F­orms.FlexGrid._flex_Paint(Object sender = {ProductVision.Windows.Forms.FlexGrid}, System.Windows.Forms.PaintEventArgs e = {ClipRectangle = {System.Drawing.Rectangle}}) Line 441 Basic

System.Windows.Forms.dll!
System.Windows.Forms.Control.OnPaint(System.Windows.Forms.PaintEventArgs
e) + 0x57 bytes
C1.Win.C1FlexGrid.2.dll!
C1.Win.C1FlexGrid.Util.BaseControls.ScrollableControl.OnPaint(System.Window­s.Forms.PaintEventArgs
e = {ClipRectangle = {X=0,Y=223,Width=262,Height=67}}) + 0x36bytes
C1.Win.C1FlexGrid.2.dll!
C1.Win.C1FlexGrid.C1FlexGridBase.OnPaint(System.Windows.Forms.PaintEventArg­s
e = {ClipRectangle = {X=0,Y=223,Width=262,Height=67}}) + 0x35bytes
System.Windows.Forms.dll!
System.Windows.Forms.Control.PaintWithErrorHandling(System.Windows.Forms.Pa­intEventArgs
e = {ClipRectangle = {X=0,Y=223,Width=262,Height=67}}, short layer,
bool disposeEventArgs = false) + 0x5b bytes
System.Windows.Forms.dll!System.Windows.Forms.Control.WmPaint(ref
System.Windows.Forms.Message m) + 0x20b bytes
System.Windows.Forms.dll!System.Windows.Forms.Control.WndProc(ref
System.Windows.Forms.Message m) + 0x2e7 bytes
C1.Win.C1FlexGrid.2.dll!
C1.Win.C1FlexGrid.Util.BaseControls.ScrollableControl.WndProc(ref
System.Windows.Forms.Message m = {msg=0xf (WM_PAINT) hwnd=0xd08b6
wparam=0x0 lparam=0x0 result=0x0}) + 0x1ef bytes
System.Windows.Forms.dll!
System.Windows.Forms.Control.ControlNativeWindow.OnMessage(ref
System.Windows.Forms.Message m) + 0xd bytes
System.Design.dll!
System.Windows.Forms.Design.ControlDesigner.DesignerWindowTarget.DefWndProc­(ref
System.Windows.Forms.Message m) + 0xb bytes
System.Design.dll!
System.Windows.Forms.Design.ControlDesigner.WndProc(ref
System.Windows.Forms.Message m = {msg=0xf (WM_PAINT) hwnd=0xd08b6
wparam=0x0 lparam=0x0 result=0x0}) + 0xcca bytes
System.Design.dll!
System.Windows.Forms.Design.ControlDesigner.DesignerWindowTarget.OnMessage(­ref
System.Windows.Forms.Message m) + 0x46 bytes
System.Windows.Forms.dll!
System.Windows.Forms.Control.ControlNativeWindow.WndProc(ref
System.Windows.Forms.Message m) + 0xd6 bytes
System.Windows.Forms.dll!
System.Windows.Forms.NativeWindow.DebuggableCallback(System.IntPtr
hWnd, int msg = 15, System.IntPtr wparam, System.IntPtr lparam) + 0x75
bytes
[Native to Managed Transition]
[Managed to Native Transition]
System.Windows.Forms.dll!System.Windows.Forms.Control.Update() +
0x6b bytes
System.Design.dll!
System.Windows.Forms.Design.Behavior.BehaviorService.AdornerWindow.Invalida­teAdornerWindow(System.Drawing.Region
region) + 0x62 bytes
System.Design.dll!
System.Windows.Forms.Design.ToolStripItemBehavior.ClearInsertionMark(System­.Windows.Forms.ToolStripItem
item) + 0x1fd bytes
System.Design.dll!
System.Windows.Forms.Design.ToolStripItemBehavior.OnMouseLeave(System.Windo­ws.Forms.Design.Behavior.Glyph
g) + 0x4d bytes
System.Design.dll!
System.Windows.Forms.Design.Behavior.BehaviorService.InvokeMouseEnterLeave(­System.Windows.Forms.Design.Behavior.Glyph
leaveGlyph, System.Windows.Forms.Design.Behavior.Glyph enterGlyph =
{System.Windows.Forms.Design.ToolStripItemGlyph}) + 0x4e bytes
System.Design.dll!
System.Windows.Forms.Design.Behavior.BehaviorService.PropagateHitTest(Syste­m.Drawing.Point
pt) + 0xaa bytes
System.Design.dll!
System.Windows.Forms.Design.Behavior.BehaviorService.AdornerWindow.WndProcP­roxy(ref
System.Windows.Forms.Message m = {msg=0x200 (WM_MOUSEMOVE)
hwnd=0xa0a80 wparam=0x0 lparam=0x2d101d3 result=0x0}, int x, int y) +
0x32 bytes
System.Design.dll!
System.Windows.Forms.Design.Behavior.BehaviorService.AdornerWindow.MouseHoo­k.ProcessMouseMessage(System.IntPtr
hWnd, int msg, int x, int y) + 0x172 bytes
System.Design.dll!
System.Windows.Forms.Design.Behavior.BehaviorService.AdornerWindow.MouseHoo­k.MouseHookProc(int
nCode = 0, System.IntPtr wparam = 512, System.IntPtr lparam = 1241372)
+ 0x5f bytes
[Native to Managed Transition]
System.Windows.Forms.dll!
System.Windows.Forms.NativeWindow.DefWndProc(ref
System.Windows.Forms.Message m = {msg=0x112 (WM_SYSCOMMAND)
hwnd=0xa0a80 wparam=0xf087 lparam=0x116fee9 result=0x0}) + 0x94 bytes
System.Windows.Forms.dll!System.Windows.Forms.Control.DefWndProc(ref
System.Windows.Forms.Message m) + 0xc bytes
System.Windows.Forms.dll!System.Windows.Forms.Control.WndProc(ref
System.Windows.Forms.Message m) + 0x38c bytes
System.Windows.Forms.dll!
System.Windows.Forms.ScrollableControl.WndProc(ref
System.Windows.Forms.Message m) + 0x45 bytes
System.Design.dll!
System.Windows.Forms.Design.DesignerFrame.OverlayControl.WndProc(ref
System.Windows.Forms.Message m = {msg=0x112 (WM_SYSCOMMAND)
hwnd=0xa0a80 wparam=0xf087 lparam=0x116fee9 result=0x0}) + 0x26 bytes
System.Windows.Forms.dll!
System.Windows.Forms.Control.ControlNativeWindow.OnMessage(ref
System.Windows.Forms.Message m) + 0xd bytes
System.Windows.Forms.dll!
System.Windows.Forms.Control.ControlNativeWindow.WndProc(ref
System.Windows.Forms.Message m) + 0xd6 bytes
System.Windows.Forms.dll!
System.Windows.Forms.NativeWindow.DebuggableCallback(System.IntPtr
hWnd, int msg = 274, System.IntPtr wparam, System.IntPtr lparam) +
0x75 bytes
[Native to Managed Transition]
[Managed to Native Transition]
System.Windows.Forms.dll!
System.Windows.Forms.NativeWindow.DefWndProc(ref
System.Windows.Forms.Message m = {msg=0xa1 (WM_NCLBUTTONDOWN)
hwnd=0xa0a80 wparam=0x7 lparam=0x116fee9 result=0x0}) + 0x94 bytes
System.Windows.Forms.dll!System.Windows.Forms.Control.DefWndProc(ref
System.Windows.Forms.Message m) + 0xc bytes
System.Windows.Forms.dll!System.Windows.Forms.Control.WndProc(ref
System.Windows.Forms.Message m) + 0x87a bytes
System.Windows.Forms.dll!
System.Windows.Forms.ScrollableControl.WndProc(ref
System.Windows.Forms.Message m) + 0x45 bytes
System.Design.dll!
System.Windows.Forms.Design.DesignerFrame.OverlayControl.WndProc(ref
System.Windows.Forms.Message m = {msg=0xa1 (WM_NCLBUTTONDOWN)
hwnd=0xa0a80 wparam=0x7 lparam=0x116fee9 result=0x0}) + 0x26 bytes
System.Windows.Forms.dll!
System.Windows.Forms.Control.ControlNativeWindow.OnMessage(ref
System.Windows.Forms.Message m) + 0xd bytes
System.Windows.Forms.dll!
System.Windows.Forms.Control.ControlNativeWindow.WndProc(ref
System.Windows.Forms.Message m) + 0xd6 bytes
System.Windows.Forms.dll!
System.Windows.Forms.NativeWindow.DebuggableCallback(System.IntPtr
hWnd, int msg = 161, System.IntPtr wparam, System.IntPtr lparam) +
0x75 bytes

That would be mdi parent of course...
 
M

mark.milley

Hi Tom -

Do you have anything specified in the form's constructor? This code
will be run when the form is loaded in the designer. If so, that may
be the cause of your loops.

Cheers,

-Mark
 
T

Tom C

Hi Tom -

Do you have anything specified in the form's constructor? This code
will be run when the form is loaded in the designer. If so, that may
be the cause of your loops.

Cheers,

-Mark

Mark,

The window itself doesn't even have constructor sub other than what
happens in the designer written code. We do have a couple of instance
variables that are declared and instantiated such as an arraylist and
booleans.

Thanks,

Tom
 
M

mark.milley

Do you have any custom controls on the form which may be attempting to
run code in their constructors or OnLoad event handlers?

Thanks,

-Mark
 
M

mark.milley

Actually, when we're talking about custom controls, they are
essentially running inside of the designer; so any code that responds
to mouse movement, etc, may be running as well.

Thanks,

-Mark
 
T

Tom C

Actually, when we're talking about custom controls, they are
essentially running inside of the designer; so any code that responds
to mouse movement, etc, may be running as well.

Thanks,

-Mark

I just have no idea how to find it, if there is offending code
executing. We have 1 custom class on the window, a c1flexgrid, with 4
instances. Now this class is inherited by the window project from yet
another library that inherits from c1 but both of these contstructors
do little more than assign some boolean values. We have numerous
instances of this same control on other windows and it causes
absolutely no problems elsewhere.

I have a debug session running against the designer and it just runs
until I do a break all and then f10 and it steps into some user code
in our flexgrid library code and our flexgrid windows code but I don't
seen any calls other than native code so don't know any other way to
examine this.

Any ideas how I can find the offending code short of a lashing?

Tom
 
M

Mark S. Milley, MCAD (BinarySwitch)

It's kind of hard to determine when I'm not looking at it...

Naturally, you can start asking yourself question such as:

What is different about this form and the ones the control is working
on?
Does this control support having multiple versions on one form/is
there any reason why it might not allow that?

....and if all else fails, you can start commenting out blocks of code
until you get it to work, and narrow down the problem that way...but
man, that's a brutal way to proceed.

When you do find the problem, there are code samples online (albeit,
buggy ones) that will return a boolean value indicating whether or not
you're in the designer. (I'm surprised there's nothing in the
framework for this by now.) You could wrap the code in that function,
or, ideally, rework your solution to avoid whatever pitfall you came
across.

I had a similar problem recently with an inherited form that behaved
irratically inside the designer. I chose to rework the solution,
because the aforementioned function only works due to a bug that will
hopefully be resolved soon.

Good luck, Tom,

-Mark
 
T

Tom C

It's kind of hard to determine when I'm not looking at it...

Naturally, you can start asking yourself question such as:

What is different about this form and the ones the control is working
on?
Does this control support having multiple versions on one form/is
there any reason why it might not allow that?

...and if all else fails, you can start commenting out blocks of code
until you get it to work, and narrow down the problem that way...but
man, that's a brutal way to proceed.

When you do find the problem, there are code samples online (albeit,
buggy ones) that will return a boolean value indicating whether or not
you're in the designer. (I'm surprised there's nothing in the
framework for this by now.) You could wrap the code in that function,
or, ideally, rework your solution to avoid whatever pitfall you came
across.

I had a similar problem recently with an inherited form that behaved
irratically inside the designer. I chose to rework the solution,
because the aforementioned function only works due to a bug that will
hopefully be resolved soon.

Good luck, Tom,

-Mark

I've asked myself several questions, some of them not very polite, but
I keep getting the same dumb answers (from myself). If anyone has any
other suggestions, I am all ears.
 
J

jeff

create a backup of the form...
open it ...
delete the grids from the form.
add them back one by one - closing / opening form in between each
re-link any code to the control.

i know this is drastic, but it will either bring the problem to the surface
or simply make the problem disappear. just be sure to backup your current
form.
 
S

ShaneO

Tom said:
I've asked myself several questions, some of them not very polite, but
I keep getting the same dumb answers (from myself). If anyone has any
other suggestions, I am all ears.


Have you bound one or more of the C1FlexGrid Controls to a Database
using the "DataSource" property in the Design Window? If so, try
releasing this and see what happens.

Also, I think you wrote that you haven't generated any code as yet, so
try removing the "ToolStrip" control that shows in the CallStack, I've
had a problem with this failing to initialize in the past.

(Just my 2-cents worth!)

ShaneO

There are 10 kinds of people - Those who understand Binary and those who
don't.
 
T

Tom C

Have you bound one or more of the C1FlexGrid Controls to a Database
using the "DataSource" property in the Design Window? If so, try
releasing this and see what happens.

Also, I think you wrote that you haven't generated any code as yet, so
try removing the "ToolStrip" control that shows in the CallStack, I've
had a problem with this failing to initialize in the past.

(Just my 2-cents worth!)

ShaneO

There are 10 kinds of people - Those who understand Binary and those who
don't.

Problem solved. Turned out to be some bad references that must have
been causing a conflict.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top