473,411 Members | 2,009 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,411 software developers and data experts.

Inheriting from an abstract class with no constructor (trying to)...

Hi Newsgroup,

Reconstructing my common dialog assembly using C# 2.0 .NET Framework 2.0. I
have the following;

public class FileDialogBase: System.Windows.Forms.FileDialog
{
//No constructor seem to do me any justice....
}

No matter what I've been doing (in terms of the class constructors) I keep
getting the error;

The type 'System.Windows.Forms.FileDialog' has no constructors defined. Does
this mean I cannot inherit from this class despite it being abstract and not
tagged as sealed? Or,

Is there something here I haven't properly considered?

Many thanks Newsgroup for you consideration.

Regards,
-SpotNet
Nov 17 '05 #1
2 6908
SpotNet wrote:
Hi Newsgroup,

Reconstructing my common dialog assembly using C# 2.0 .NET Framework
2.0. I have the following;

public class FileDialogBase: System.Windows.Forms.FileDialog
{
//No constructor seem to do me any justice....
}

No matter what I've been doing (in terms of the class constructors)
I keep getting the error;

The type 'System.Windows.Forms.FileDialog' has no constructors
defined. Does this mean I cannot inherit from this class despite it
being abstract and not tagged as sealed? Or,

Is there something here I haven't properly considered?

Many thanks Newsgroup for you consideration.


From the documentation:
"FileDialog is an abstract class, and cannot be created directly.
Additionally, you cannot inherit from this class"

So you can't inherit from this class (i.e.: it has an internal
constructor).

FB

--
------------------------------------------------------------------------
Get LLBLGen Pro, productive O/R mapping for .NET: http://www.llblgen.com
My .NET blog: http://weblogs.asp.net/fbouma
Microsoft MVP (C#)
------------------------------------------------------------------------
Nov 17 '05 #2

Thanks for the clarification Frans, I can now execute plan B. It also
reminds me to look up the documentation rather than the little notes you get
at the bottom right corner of the Object Browser. Thanks again Frans.

Regards,
SpotNet.

"Frans Bouma [C# MVP]" <pe******************@xs4all.nl> wrote in message
news:xn***************@news.microsoft.com...
SpotNet wrote:
Hi Newsgroup,

Reconstructing my common dialog assembly using C# 2.0 .NET Framework
2.0. I have the following;

public class FileDialogBase: System.Windows.Forms.FileDialog
{
//No constructor seem to do me any justice....
}

No matter what I've been doing (in terms of the class constructors)
I keep getting the error;

The type 'System.Windows.Forms.FileDialog' has no constructors
defined. Does this mean I cannot inherit from this class despite it
being abstract and not tagged as sealed? Or,

Is there something here I haven't properly considered?

Many thanks Newsgroup for you consideration.


From the documentation:
"FileDialog is an abstract class, and cannot be created directly.
Additionally, you cannot inherit from this class"

So you can't inherit from this class (i.e.: it has an internal
constructor).

FB

--
------------------------------------------------------------------------
Get LLBLGen Pro, productive O/R mapping for .NET: http://www.llblgen.com
My .NET blog: http://weblogs.asp.net/fbouma
Microsoft MVP (C#)
------------------------------------------------------------------------

Nov 17 '05 #3

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

Similar topics

12
by: Daedalus.OS | last post by:
Ok first I'm pretty new to OOP, so my question may sound stupid to some of you. If the only answer you can provide is "get a book about OOP" then don't loose your time and mine cause it's already...
11
by: Noah Coad [MVP .NET/C#] | last post by:
How do you make a member of a class mandatory to override with a _new_ definition? For example, when inheriting from System.Collections.CollectionBase, you are required to implement certain...
10
by: Opa | last post by:
I have tried for two days to solve this problem with no luck. I have a singleton class which has some events declared. When I inherit from this class the events don't seem to come along with it....
10
by: Brett Romero | last post by:
Say I have a class inheriting some base class: BaseClass { void Foo() { Update(); } }
2
by: talkingpidgin | last post by:
I am trying to figure out why it is not conventional to use protected constructors in abstract classes since the only time they should be called is by the constructors of it's derived classes. Is...
2
by: Zytan | last post by:
I know that WebRequest.GetResponse can throw WebException from internet tutorials. However in the MSDN docs: http://msdn2.microsoft.com/en-us/library/system.net.webrequest.getresponse.aspx It...
17
by: Jess | last post by:
Hello, If I have a class that has virtual but non-pure declarations, like class A{ virtual void f(); }; Then is A still an abstract class? Do I have to have "virtual void f() = 0;"...
20
by: tshad | last post by:
Using VS 2003, I am trying to take a class that I created to create new variable types to handle nulls and track changes to standard variable types. This is for use with database variables. This...
4
by: dascandy | last post by:
Hi, For a project I'm working on I'm kind-of-hacking my way around deriving a class from an interface or such to create a mock, but instead creating the mock directly. It is usable as the...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
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...

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.