473,729 Members | 2,371 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

cannot derive from sealed type 'float'

I try to compile myGeneration source code using Visual C# Express 2005
Express.

File starts with

using System;
using System.Xml;
using System.Data;
using System.Data.Ole Db;

namespace MyMeta
{
public class Table : Single, ITable, INameValueItem
{
public Table()
{

}
compiling causes error in "public class Table line":

MyMeta.Table': cannot derive from sealed type 'float'
This is working code so i expect that code is correct and can be compiled t
can be compiled in some way without changing it.

Why I got compile error ?
How to fix ?

Andrus.

Jul 20 '07 #1
2 5315
I try to compile myGeneration source code using Visual C# Express 2005
Express.

File starts with

using System;
using System.Xml;
using System.Data;
using System.Data.Ole Db;
namespace MyMeta
{
public class Table : Single, ITable, INameValueItem
{
public Table()
{
}

compiling causes error in "public class Table line":

MyMeta.Table': cannot derive from sealed type 'float'

This is working code so i expect that code is correct and can be
compiled t can be compiled in some way without changing it.

Why I got compile error ?
How to fix ?
Andrus.
Do you have your own 'Single' type? The compiler treats the 'Single' you
mention as System.Single, for which 'float' is an alias.
If it is your own type, use the full namespace.

Hans Kesting
Jul 20 '07 #2
Andrus,

It is not working code. Single (float) is a value type, and they are
sealed, you can not derive from them.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"Andrus" <ko********@hot .eewrote in message
news:uX******** ******@TK2MSFTN GP03.phx.gbl...
>I try to compile myGeneration source code using Visual C# Express 2005
Express.

File starts with

using System;
using System.Xml;
using System.Data;
using System.Data.Ole Db;

namespace MyMeta
{
public class Table : Single, ITable, INameValueItem
{
public Table()
{

}
compiling causes error in "public class Table line":

MyMeta.Table': cannot derive from sealed type 'float'
This is working code so i expect that code is correct and can be compiled
t can be compiled in some way without changing it.

Why I got compile error ?
How to fix ?

Andrus.

Jul 20 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
7635
by: Bharat Karia | last post by:
Hi, Is it possible to writed Sealed classes in C++ . i.e. there is no sealed/final keyword in C++, but is it possible to achieve the same effect? i.e. deriving from a sealed class is an error and the compiler should flag it as such. Thanks Bharat Karia
3
6102
by: Marcin Kowalewski | last post by:
Hi I've got a stupid problem with code below : using System; using System.Drawing; .... public class CsrcImage :Image { public CsrcImage() { //
13
8104
by: Mark Rae | last post by:
Hi, Since sealed classes can't be instantiated with the new keyword e.g. CClass objClass = new CClass(), does this mean that they don't have constructors / deconstructors or, if they do, that the code inside the constructor / desconstructor will never run? Mark
1
18196
by: Marc | last post by:
Hi! I'm working with a C# client that calls a php web service. I've created a wrapper to call the service using .NET wsdl tool (adding a web reference). The call to the server works fine, it is serialized correctly, and the server returns a response (I've captured the response and it's correct!) but when the .NET deserialize this response, it throws the exception "System.InvalidOperationException: There is an error in XML
0
1253
by: Ken Varn | last post by:
I have the following code that I cannot get to compile. I get the error "A Sealed class cannot be abstract." public __value struct DVRAVIFileHeader : public ISerializable { double EventID; String *EventName; USHORT EventNum; String *EventType;
3
13944
by: bg_ie | last post by:
Hi, I am using a API I downloaded from the internet programmed in C. I need the function below which works with this api in my c++ file - void StoreNoteCallback(void *context, int arglen, const void *args, OSCTimeTag when, NetworkReturnAddressPtr returnAddr) { const char *typeArgs = (const char *)args;
2
5783
by: andy6 via DotNetMonster.com | last post by:
I took a c++ 6.0 project and converted it to c++ .net 2005 project. I want to make a web service out of it. One of the new files I created was a cpp where I have the webmethod pointing to a function in the previously 6.0 code and I get the error noted below. What I don't understand is since I created this cpp as a new file in .net and inherited from a .net base class then why would I get this error? Both the class and base class to me...
7
1842
by: Zytan | last post by:
I know you cannot have a sealed static class, but why not? Why must static classes be left open to inheritance? This article: http://msdn.microsoft.com/msdnmag/issues/03/07/NET/ recommends to place DLL imports into a sealed class, with a private constructor to prevent instantiation (see Figure 1 at the very top): http://msdn.microsoft.com/msdnmag/issues/03/07/NET/default.aspx?loc=&fig=true#fig1 Why not just make a static class to...
1
5997
by: ivanet | last post by:
Hello everyone, I am trying to use the following Schema but I get the error "src- resolve: Cannot resolve the name 'ValuesList' to a(n) 'element declaration' component." at line 144. I have been reading http://www.w3.org/TR/xmlschema-1/#src-resolve, but I don't get what is wrong. Can anyone give me a hint? Thanks in advance.
0
8921
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8763
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
9202
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8151
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6022
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4528
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4796
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3238
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2683
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.