inheritance from own class

  • Thread starter Tomas Munch via .NET 247
  • Start date
T

Tomas Munch via .NET 247

Hi

I got a problem with the Microsoft Visual Studio .NET 2003 and the compact framework.

A try to inheritance from System.Windows.Forms.form in my own class, and the inheritance from my own class in my form

But this failed after an reopen of the project.

I have made a short step by step describtion, on howto see the fault:

1. Open Visual Studio -> New project
2. Visual C# Projects - Smart Device Application - call it MyProject
3. 3. Windows CE - Windows Application
4. Width: 240 - height: 320
5. Add new class
6. Call it MyClass.cs
7. Edit "public class MyClass" into "public class MyClass : System.Windows.Forms.Form"
8. Save MyClass
9. Edit "public class Form1 : System.Windows.Forms.Form" into "public class Form1 : MyClass"
10. Save all, compile and everything works fine, no problems so far.
11. Close Visual Studio
12. Open Visual Studio and open solution, now I got the following error:

" Object type cannot be converted to target type."
" Error reading resources from the resource file for the default culture: Invalid ResX input. Could not find valid "resheader" tags for the ResX reader & writer type names."

And the form has lost the width and height i set in 4.

If I try to compile I get a lot of errors.

For me it seems like the project is CompactFramework, but the forms properties change to standard framework.
This add some extra properties to the formobject, which not is supported by the CompactFramework.

If I use the same guide, but use standard Windows application, everything works fine.

Can anybody help me, about what is going on? Is this a bug in the Visual Studio, or what do I do?

Best Regards
Tomas Munch
 
C

Chris Tacke, eMVP

It probably working fine, but the designer doesn't support visual
inheritance, so you cannot expect to be able to view your new class in the
designer.

-Chris


Tomas Munch via .NET 247 said:
Hi

I got a problem with the Microsoft Visual Studio .NET 2003 and the compact framework.

A try to inheritance from System.Windows.Forms.form in my own class, and
the inheritance from my own class in my form
But this failed after an reopen of the project.

I have made a short step by step describtion, on howto see the fault:

1. Open Visual Studio -> New project
2. Visual C# Projects - Smart Device Application - call it MyProject
3. 3. Windows CE - Windows Application
4. Width: 240 - height: 320
5. Add new class
6. Call it MyClass.cs
7. Edit "public class MyClass" into "public class MyClass : System.Windows.Forms.Form"
8. Save MyClass
9. Edit "public class Form1 : System.Windows.Forms.Form" into "public class Form1 : MyClass"
10. Save all, compile and everything works fine, no problems so far.
11. Close Visual Studio
12. Open Visual Studio and open solution, now I got the following error:

" Object type cannot be converted to target type."
" Error reading resources from the resource file for the default culture:
Invalid ResX input. Could not find valid "resheader" tags for the ResX
reader & writer type names."
And the form has lost the width and height i set in 4.

If I try to compile I get a lot of errors.

For me it seems like the project is CompactFramework, but the forms
properties change to standard framework.
 

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