Undefined Error

G

Guest

Hello Developpers
I faced with an undefined error. I developped a Windows Forms Application. When I opened my project's Solution, all the documents, which were created before, listed properly at the Solution Explorer. But when I wanted to see my form by clicking on to Design View, the following error message displayed instead of the form itself
----> An error occurred while loading the document. Fix the error, and then try loading the document again. The error message follows
Belirtilmemis hata (<-This message is in Turkish. It says Undefined Error

I tried to opend my Windows forms, but I could not. I also checked my previously developed and design projects' forms. They could not be openned also

Do you have any Idea

Thank you very much from now.
 
G

Guest

H

Please check the form is inheriting from System.Windows.Forms.Form or not. If not inherit the same from System.Windows.Forms.Form. Or if you are inheriting from some other Class check that base class's Base class(means base classes inherits Keyword

Regard

Sooraj P
Microsoft India Community Star
 
S

Stoitcho Goutsev \(100\) [C# MVP]

Hi Alper,
This is only a wild guess. Check to make sure that in the file with the form
class the form is the first class declared. I guess this is not the problem
because in this case VS.NET gives pretty clear error message.

--

Stoitcho Goutsev (100) [C# MVP]


Alper Akcayoz said:
Hello Developpers,
I faced with an undefined error. I developped a Windows Forms Application.
When I opened my project's Solution, all the documents, which were created
before, listed properly at the Solution Explorer. But when I wanted to see
my form by clicking on to Design View, the following error message displayed
instead of the form itself:
----> An error occurred while loading the document. Fix the error, and
then try loading the document again. The error message follows:
Belirtilmemis hata (<-This message is in Turkish. It says Undefined Error)

I tried to opend my Windows forms, but I could not. I also checked my
previously developed and design projects' forms. They could not be openned
also.
 
G

Guest

Hello Stoitcho
Thank you very much for your response
I think , as you mentioned, the problem is different. But "where?!?!", I really have no idea. I check your opinion. The Form1 is the the first initialized class. I did not change anything at the code. The automatically generated code is as below

Form1.
----------------------------------------------------------------------------------------------
#pragma onc
namespace TestFace_0

....
public __gc class Form1 : public System::Windows::Forms::For
{
public
Form1(void

InitializeComponent()

...
//Rest is the generated codes and my code

} // public __gc class Form1 : public System::Windows::Forms::For
} //namespace TestFace_01
 
G

Guest

Hello Sooraj
Thank you very much for your response
I checked your recommendation. As you mentioned form is inhereted from System.Windows.Forms.Form. This is automatically generated code, and I did not change anything here. I also added new Windows Form(.NET) template, its form design view is not visibile, too.
I have this problem only in my previously (3 weeks ago) designed forms, not in the newly projects
About inhereting the System.Windows.Forms.Form, you may check my code below. It is a normally generated initial codes

Form1.
----------------------------------------------------------------------------------------------
#pragma onc
namespace TestFace_0

....
public __gc class Form1 : public System::Windows::Forms::For
{
public
Form1(void

InitializeComponent()

...
//Rest is the generated codes and my code

} // public __gc class Form1 : public System::Windows::Forms::For
} //namespace TestFace_01
 

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