Click here to Skip to main content
15,884,760 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
A System.InvalidOperationException was thrown: "The form referred to itself during construction from a default instance, which led to infinite recursion.  Within the Form's constructor refer to the form using 'Me.'"
Time: 9/15/2015 4:11:59 PM
Thread:<no name="">[3020]


in this part of the code:

VB
bmpDeck = DirectCast(formx.vspdeck.GetCurrentVideoFrame().Clone(), Bitmap)

and cannot load form:
VB
<Global.System.Diagnostics.DebuggerStepThroughAttribute()>  _
     Protected Overrides Sub OnCreateMainForm()
         Me.MainForm = Global.ImageComparison.Formx
     End Sub
Posted
Updated 14-Sep-15 22:27pm
v2

1 solution

The error is pretty explicit:
The form referred to itself during construction from a default instance, which led to infinite recursion.  Within the Form's constructor refer to the form using 'Me.'

So start with the form constructor, and start looking for references to form instances or new form instances being created. Putting a breakpoint on the constructor and following it through would be a good idea.

We can't do that for you: we don't have access to your code!
 
Share this answer
 
Comments
hypermellow 15-Sep-15 4:59am    
Good advice ... a sensible approach. 5'd

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900