473,769 Members | 7,375 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Why cannot inherit from public class that can be instantiated?

Can any Public class be inherited from? I installed some software on
my pc and I can use it in my code, but I cannot seem to inherit from
it. It was an executable that installed on my pc, I do not understand
how that works, but I can use it. I put it in the references to use
it in my code.

If I look at the definition it just says..
Public Class CABEthernet
Member of: vHMIABE

I can do the following....

Public Class MyClass
Public myInstance as new vHMIABE.CABEthe rnet
End Class

Shouldn't I be able to do the following...

Public Class MyClass
Inherits vHMIABE.CABEthe rnet
End Class

Feb 21 '07 #1
8 1683
"blisspikle " <er***@johndenl ey.netschrieb
Can any Public class be inherited from?
Yes, unless it's marked as NotInheritable or if it only has private
constructors (sub new).
I installed some software
on my pc and I can use it in my code, but I cannot seem to inherit
from it.
Why? Do you get an error message? Which one?
It was an executable that installed on my pc, I do not
understand how that works, but I can use it. I put it in the
references to use it in my code.

If I look at the definition it just says..
Public Class CABEthernet
Member of: vHMIABE

I can do the following....

Public Class MyClass
Public myInstance as new vHMIABE.CABEthe rnet
End Class

Shouldn't I be able to do the following...

Public Class MyClass
Inherits vHMIABE.CABEthe rnet
End Class

Armin

Feb 21 '07 #2
On Feb 21, 4:04 pm, "Armin Zingler" <az.nos...@free net.dewrote:
"blisspikle " <e...@johndenle y.netschrieb
Can any Public class be inherited from?

Yes, unless it's marked as NotInheritable or if it only has private
constructors (sub new).
I installed some software
on my pc and I can use it in my code, but I cannot seem to inherit
from it.

Why? Do you get an error message? Which one?


It was an executable that installed on my pc, I do not
understand how that works, but I can use it. I put it in the
references to use it in my code.
If I look at the definition it just says..
Public Class CABEthernet
Member of: vHMIABE
I can do the following....
Public Class MyClass
Public myInstance as new vHMIABE.CABEthe rnet
End Class
Shouldn't I be able to do the following...
Public Class MyClass
Inherits vHMIABE.CABEthe rnet
End Class

Armin- Hide quoted text -

- Show quoted text -
VB underlines and It gives me a "Classes can inherit only from other
Classes" error.

When I go to the definition it does not have any New() methods
listed. Does this mean that it cannot be inherited from?

Thank you,
Feb 22 '07 #3
On Feb 21, 4:04 pm, "Armin Zingler" <az.nos...@free net.dewrote:
"blisspikle " <e...@johndenle y.netschrieb
Can any Public class be inherited from?

Yes, unless it's marked as NotInheritable or if it only has private
constructors (sub new).
I installed some software
on my pc and I can use it in my code, but I cannot seem to inherit
from it.

Why? Do you get an error message? Which one?


It was an executable that installed on my pc, I do not
understand how that works, but I can use it. I put it in the
references to use it in my code.
If I look at the definition it just says..
Public Class CABEthernet
Member of: vHMIABE
I can do the following....
Public Class MyClass
Public myInstance as new vHMIABE.CABEthe rnet
End Class
Shouldn't I be able to do the following...
Public Class MyClass
Inherits vHMIABE.CABEthe rnet
End Class

Armin- Hide quoted text -

- Show quoted text -
I suppose another question would be, if the class has to be
instantiated and used can you get to the methods from the calling code
similar to if they were just inherited? I only need one instance of
the class I would like to inherit from. and there is very little I
would like to add to it.

Thanks,

Feb 22 '07 #4
"blisspikle " <er***@johndenl ey.netschrieb:
It was an executable that installed on my pc, I do not
understand how that works, but I can use it. I put it in the
references to use it in my code.
If I look at the definition it just says..
Public Class CABEthernet
Member of: vHMIABE
I can do the following....
Public Class MyClass
Public myInstance as new vHMIABE.CABEthe rnet
End Class
Shouldn't I be able to do the following...
Public Class MyClass
Inherits vHMIABE.CABEthe rnet
End Class

VB underlines and It gives me a "Classes can inherit only from other
Classes" error.
Are you sure the "class" is actually a class and not a structure?
When I go to the definition it does not have any New() methods
listed.
This would mean that you cannot even instantiate it.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Feb 22 '07 #5
On Feb 22, 8:25 am, "Herfried K. Wagner [MVP]" <hirf-spam-me-
h...@gmx.atwrot e:
"blisspikle " <e...@johndenle y.netschrieb:


It was an executable that installed on my pc, I do not
understand how that works, but I can use it. I put it in the
references to use it in my code.
If I look at the definition it just says..
Public Class CABEthernet
Member of: vHMIABE
I can do the following....
Public Class MyClass
Public myInstance as new vHMIABE.CABEthe rnet
End Class
Shouldn't I be able to do the following...
Public Class MyClass
Inherits vHMIABE.CABEthe rnet
End Class
VB underlines and It gives me a "Classes can inherit only from other
Classes" error.

Are you sure the "class" is actually a class and not a structure?
When I go to the definition it does not have any New() methods
listed.

This would mean that you cannot even instantiate it.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>- Hide quoted text -

- Show quoted text -
It does have Methods in it, which it wouldn't if it was a structure
right? I am almost sure that it is a class. When I "right click" and
"go to definition" in VS2005 it tells me this...

Public Class CABEthernet
Member of: vHMIABE

When I click on it there are no New() methods that come up as
visible. I can instantiate this class and use it all I want though,
it works fine. I just wish that I could add a couple of properties to
it and still use it.

Thanks,

Feb 22 '07 #6
Is this a DOTNET class ? Another possibility would be that this is actually
a COM class.

In this case try :
http://msdn2.microsoft.com/en-us/library/2044hysa.aspx

(basically try Inherits vHMIOABE.CABEth ernetClass and see if it works (note
the appended "Class"))
"blisspikle " <er***@johndenl ey.neta écrit dans le message de news:
11************* *********@p10g2 00...legr oups.com...
On Feb 22, 8:25 am, "Herfried K. Wagner [MVP]" <hirf-spam-me-
h...@gmx.atwrot e:
>"blisspikle " <e...@johndenle y.netschrieb:


It was an executable that installed on my pc, I do not
understand how that works, but I can use it. I put it in the
references to use it in my code.
If I look at the definition it just says..
Public Class CABEthernet
Member of: vHMIABE
I can do the following....
Public Class MyClass
Public myInstance as new vHMIABE.CABEthe rnet
End Class
Shouldn't I be able to do the following...
Public Class MyClass
Inherits vHMIABE.CABEthe rnet
End Class
VB underlines and It gives me a "Classes can inherit only from other
Classes" error.

Are you sure the "class" is actually a class and not a structure?
When I go to the definition it does not have any New() methods
listed.

This would mean that you cannot even instantiate it.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>- Hide quoted text -

- Show quoted text -

It does have Methods in it, which it wouldn't if it was a structure
right? I am almost sure that it is a class. When I "right click" and
"go to definition" in VS2005 it tells me this...

Public Class CABEthernet
Member of: vHMIABE

When I click on it there are no New() methods that come up as
visible. I can instantiate this class and use it all I want though,
it works fine. I just wish that I could add a couple of properties to
it and still use it.

Thanks,

Feb 22 '07 #7
"blisspikle " <er***@johndenl ey.netschrieb
On Feb 22, 8:25 am, "Herfried K. Wagner [MVP]" <hirf-spam-me-
h...@gmx.atwrot e:
"blisspikle " <e...@johndenle y.netschrieb:


It was an executable that installed on my pc, I do not
understand how that works, but I can use it. I put it in
the references to use it in my code.
If I look at the definition it just says..
Public Class CABEthernet
Member of: vHMIABE
I can do the following....
Public Class MyClass
Public myInstance as new vHMIABE.CABEthe rnet
End Class
Shouldn't I be able to do the following...
Public Class MyClass
Inherits vHMIABE.CABEthe rnet
End Class
VB underlines and It gives me a "Classes can inherit only from
other Classes" error.
Are you sure the "class" is actually a class and not a structure?
When I go to the definition it does not have any New() methods
listed.
This would mean that you cannot even instantiate it.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>- Hide quoted text
-

- Show quoted text -

It does have Methods in it, which it wouldn't if it was a structure
right? I am almost sure that it is a class. When I "right click"
and "go to definition" in VS2005 it tells me this...

Public Class CABEthernet
Member of: vHMIABE

When I click on it there are no New() methods that come up as
visible. I can instantiate this class and use it all I want though,
it works fine. I just wish that I could add a couple of properties
to it and still use it.

Sorry, I currently have no clue why this is.
Armin
Feb 22 '07 #8
On Feb 22, 11:37 am, "Patrice" <http://www.chez.com/scribe/wrote:
Is this a DOTNET class ? Another possibility would be that this is actually
a COM class.

In this case try :http://msdn2.microsoft.com/en-us/library/2044hysa.aspx

(basically try Inherits vHMIOABE.CABEth ernetClass and see if it works (note
the appended "Class"))

"blisspikle " <e...@johndenle y.neta écrit dans le message de news:
1172160150.0168 76.237...@p10g2 000cwp.googlegr oups.com...
On Feb 22, 8:25 am, "Herfried K. Wagner [MVP]" <hirf-spam-me-
h...@gmx.atwrot e:
"blisspikle " <e...@johndenle y.netschrieb:
It was an executable that installed on my pc, I do not
understand how that works, but I can use it. I put it in the
references to use it in my code.
If I look at the definition it just says..
Public Class CABEthernet
Member of: vHMIABE
I can do the following....
Public Class MyClass
Public myInstance as new vHMIABE.CABEthe rnet
End Class
Shouldn't I be able to do the following...
Public Class MyClass
Inherits vHMIABE.CABEthe rnet
End Class
VB underlines and It gives me a "Classes can inherit only from other
Classes" error.
Are you sure the "class" is actually a class and not a structure?
When I go to the definition it does not have any New() methods
listed.
This would mean that you cannot even instantiate it.
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>- Hide quoted text -
- Show quoted text -
It does have Methods in it, which it wouldn't if it was a structure
right? I am almost sure that it is a class. When I "right click" and
"go to definition" in VS2005 it tells me this...
Public Class CABEthernet
Member of: vHMIABE
When I click on it there are no New() methods that come up as
visible. I can instantiate this class and use it all I want though,
it works fine. I just wish that I could add a couple of properties to
it and still use it.
Thanks,- Hide quoted text -

- Show quoted text -
That worked great. I just did...

Public Class MyClass
Inherits vHMIABE.CABEthe rnetClass

The msdn article that you gave me is hard to read, I am glad you gave
me a clue. I believe the code that I downloaded was written in an
earlier version of vb, because an example project came with it and
vb.net had to convert it when I opened it.

Thank you,

Feb 23 '07 #9

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

Similar topics

2
2800
by: Yasutaka Ito | last post by:
Hi folks! I have a BaseForm class that inherits System.Windows.Forms.Form. It has a property, whose value I need supplied by the class that inherits it. The BaseForm usees the value supplied into this property in its Load event. So, I gave the BaseForm and the property 'abstract' modifier, and put the implementation of the property in the inherited class; say MyForm. However, when I did this, I no longer can open MyForm in the design...
8
21723
by: Dev | last post by:
Hello, Why an Abstract Base Class cannot be instantiated ? Does anybody know of the object construction internals ? What is the missing information that prevents the construction ? TIA. Dev
4
27448
by: Slavyan | last post by:
(I just started to learn C#.NET) What's the syntax in c# for a class to inherit more than one class. I know following syntax: public class MyClass : MyOtherClass { } but I need to inherit one more class.
5
1764
by: john conwell | last post by:
I'm trying to make a class that already inherits from a base class, also inherit from an interface in managed C++. so my interface looks like so: __gc interface ITask { __property String* get_Subject(); };
0
1236
by: Janaka | last post by:
I'm using Web Matrix and a custom built DLL which I've placed in my /bin directory for my website on a Windows 2003 server. I'm using the same setup which worked previously on Windows 2000. Any of the classes in the dll which need to be instantiated work correctly. for example the following is fine: public class Tester { public int Add(int x, int y) {return x + y;}
3
4592
by: Jill Graham | last post by:
Hi folks, The pages of my website are built dynamically and are based on templates. A template can look like this : <table> <tr><td>This is the page header</td></tr> <tr><td>This is the page content</td></tr> <tr><td>This is the page footer</td></tr>
7
1756
by: Frank | last post by:
Hi, a question probably asked before, but I can't find the answers. Base class X, classes A, B and C inherit class X. In class A I do not want to inherit property (or function or method) P1. Possible? How? Thanks in advance Frank
4
5833
by: ThunderMusic | last post by:
Hi, I have a custom form that works fine when I debug it or run it in release mode but cannot be loaded in the designer... Actually, it can be loaded in the designer when no control is on it, but the resizing tool (in the designer) is offset both horizontally and vertically and when I put a control on it, as soon as I save, the designer throws an exception (but cannot be reproduced everytime) and the form cannot be loaded anymore unless...
9
2240
by: phenrol | last post by:
I am trying to access a pointer to a class that I defined in a separate source file from another one. Here is an example of what I have: //myclass.h file class testclass { public: testclass::testclass(void); int setintfunction(int testinteger); int getintfunction(void); testclass::~testclass(voide);
0
9423
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,...
0
10216
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9997
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
8873
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...
1
7413
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5309
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...
1
3965
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
3565
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.