473,659 Members | 2,663 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Instance of derived class does not show public methods or properties that are not in the inherited class

What is happening is that I have a class (ClassA) that inherits a class
(ClassB) which inherits System.Net.Mail .MailMessage

Project 1 references Project 2,
Project 2 references Project 3.

When I declare an instance of "ClassA" in a thrid project I get all of the
public methods/properties that are in the System.Net.Mail .MailMessage class,
but I do not get any of the public methods or properties that are
specirfically declared in Class B

Has anyone seen this before or could help me along in this situation?
Thanks...

I am using VS.NET 2005.
PROJECT 3
=========
Public MustInherit Class EmailMessage_Ba se

Inherits System.Net.Mail .MailMessage

Public Sub New()

mybase.new()

End Sub

Public Sub Test

End Sub

End Class

PROJECT 2
==========

Public Class EmailMessage

Inherits Project3.EmailM essage_Base

Public Sub New()

MyBase.New()

''''typing in me. brings up Test in the intellisense to the class at least
knows it is there
End Sub

End Class

PROJECT 1
=========

Public Class Form1

Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As
System.EventArg s) Handles Button1.Click

Dim mail As New Project2.EmailM essage()

mail.From = New System.Net.Mail .MailAddress("s o*******@email. com")

mail.To.Add("te st")

mail.Bcc.Add("t e**@test.com")

mail.CC.Add("br **@psfdgfdgsfdg tran.comm")

mail.Subject = "sdfgs"

mail.Body = "testing"

mail.Test '<--------------Test does not show up in the list of methods in
the intellisense
End Sub

End Class
Mar 27 '06 #1
5 1456
Putting the whole thing into a file, works... Perhaps a reference
(1->3) is missing...
Let me know...

-tom

----------------
Public MustInherit Class EmailMessage_Ba se
Inherits System.Net.Mail .MailMessage

Public Sub New()
MyBase.new()
End Sub

Public Sub Test()
End Sub

End Class

Public Class EmailMessage
Inherits EmailMessage_Ba se

Public Sub New()

MyBase.New()
'typing in me. brings up Test in the intellisense to the class
at least
'knows(it Is there)
End Sub

End Class
Public Class Form1

Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As
System.EventArg s) Handles Button1.Click

Dim mail As New EmailMessage()

mail.From = New
System.Net.Mail .MailAddress("s omeem...@email. com")
mail.To.Add("te st")
mail.Bcc.Add("t ...@test.com")
mail.CC.Add("b. ..@psfdgfdgsfdg tran.comm")
mail.Subject = "sdfgs"
mail.Body = "testing"
mail.Test() '<--------------Test does not show up in the list
of methods in
'the(intellisen se)

'It appears to me !

End Sub

End Class

D Witherspoon ha scritto:
What is happening is that I have a class (ClassA) that inherits a class
(ClassB) which inherits System.Net.Mail .MailMessage

Project 1 references Project 2,
Project 2 references Project 3.

When I declare an instance of "ClassA" in a thrid project I get all of the
public methods/properties that are in the System.Net.Mail .MailMessage class,
but I do not get any of the public methods or properties that are
specirfically declared in Class B

Has anyone seen this before or could help me along in this situation?
Thanks...

I am using VS.NET 2005.
PROJECT 3
=========
Public MustInherit Class EmailMessage_Ba se

Inherits System.Net.Mail .MailMessage

Public Sub New()

mybase.new()

End Sub

Public Sub Test

End Sub

End Class

PROJECT 2
==========

Public Class EmailMessage

Inherits Project3.EmailM essage_Base

Public Sub New()

MyBase.New()

''''typing in me. brings up Test in the intellisense to the class at least
knows it is there
End Sub

End Class

PROJECT 1
=========

Public Class Form1

Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As
System.EventArg s) Handles Button1.Click

Dim mail As New Project2.EmailM essage()

mail.From = New System.Net.Mail .MailAddress("s o*******@email. com")

mail.To.Add("te st")

mail.Bcc.Add("t e**@test.com")

mail.CC.Add("br **@psfdgfdgsfdg tran.comm")

mail.Subject = "sdfgs"

mail.Body = "testing"

mail.Test '<--------------Test does not show up in the list of methods in
the intellisense
End Sub

End Class


Mar 27 '06 #2
Reference project 3 in project 1 or set up an override and call base in
Project2.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

*************** ************
Think Outside the Box!
*************** ************
"D Witherspoon" wrote:
What is happening is that I have a class (ClassA) that inherits a class
(ClassB) which inherits System.Net.Mail .MailMessage

Project 1 references Project 2,
Project 2 references Project 3.

When I declare an instance of "ClassA" in a thrid project I get all of the
public methods/properties that are in the System.Net.Mail .MailMessage class,
but I do not get any of the public methods or properties that are
specirfically declared in Class B

Has anyone seen this before or could help me along in this situation?
Thanks...

I am using VS.NET 2005.
PROJECT 3
=========
Public MustInherit Class EmailMessage_Ba se

Inherits System.Net.Mail .MailMessage

Public Sub New()

mybase.new()

End Sub

Public Sub Test

End Sub

End Class

PROJECT 2
==========

Public Class EmailMessage

Inherits Project3.EmailM essage_Base

Public Sub New()

MyBase.New()

''''typing in me. brings up Test in the intellisense to the class at least
knows it is there
End Sub

End Class

PROJECT 1
=========

Public Class Form1

Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As
System.EventArg s) Handles Button1.Click

Dim mail As New Project2.EmailM essage()

mail.From = New System.Net.Mail .MailAddress("s o*******@email. com")

mail.To.Add("te st")

mail.Bcc.Add("t e**@test.com")

mail.CC.Add("br **@psfdgfdgsfdg tran.comm")

mail.Subject = "sdfgs"

mail.Body = "testing"

mail.Test '<--------------Test does not show up in the list of methods in
the intellisense
End Sub

End Class

Mar 28 '06 #3
Could you explain what the logic behind this is? Or help me understand...

Why would Project 3 have to reference Project 1? If it is inheriting,
shouldn't Project 3 be able to use all the members that the class in Project
2 is inheriting already?


"Cowboy (Gregory A. Beamer) - MVP" <No************ @comcast.netNoS pamM> wrote
in message news:02******** *************** ***********@mic rosoft.com...
Reference project 3 in project 1 or set up an override and call base in
Project2.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

*************** ************
Think Outside the Box!
*************** ************
"D Witherspoon" wrote:
What is happening is that I have a class (ClassA) that inherits a class
(ClassB) which inherits System.Net.Mail .MailMessage

Project 1 references Project 2,
Project 2 references Project 3.

When I declare an instance of "ClassA" in a thrid project I get all of
the
public methods/properties that are in the System.Net.Mail .MailMessage
class,
but I do not get any of the public methods or properties that are
specirfically declared in Class B

Has anyone seen this before or could help me along in this situation?
Thanks...

I am using VS.NET 2005.
PROJECT 3
=========
Public MustInherit Class EmailMessage_Ba se

Inherits System.Net.Mail .MailMessage

Public Sub New()

mybase.new()

End Sub

Public Sub Test

End Sub

End Class

PROJECT 2
==========

Public Class EmailMessage

Inherits Project3.EmailM essage_Base

Public Sub New()

MyBase.New()

''''typing in me. brings up Test in the intellisense to the class at
least
knows it is there
End Sub

End Class

PROJECT 1
=========

Public Class Form1

Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As
System.EventArg s) Handles Button1.Click

Dim mail As New Project2.EmailM essage()

mail.From = New System.Net.Mail .MailAddress("s o*******@email. com")

mail.To.Add("te st")

mail.Bcc.Add("t e**@test.com")

mail.CC.Add("br **@psfdgfdgsfdg tran.comm")

mail.Subject = "sdfgs"

mail.Body = "testing"

mail.Test '<--------------Test does not show up in the list of methods
in
the intellisense
End Sub

End Class

Mar 28 '06 #4
Looks like referencing is not "transitive " (like inheritance). It's
more just a matter of scope...
Perhaps since you had in mind the idea of inheritance you were kind of
extending it also to references, but as you have demonstrated, the idea
does not seem to apply...

D Witherspoon ha scritto:
Could you explain what the logic behind this is? Or help me understand...

Why would Project 3 have to reference Project 1? If it is inheriting,
shouldn't Project 3 be able to use all the members that the class in Project
2 is inheriting already?


"Cowboy (Gregory A. Beamer) - MVP" <No************ @comcast.netNoS pamM> wrote
in message news:02******** *************** ***********@mic rosoft.com...
Reference project 3 in project 1 or set up an override and call base in
Project2.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

*************** ************
Think Outside the Box!
*************** ************
"D Witherspoon" wrote:
What is happening is that I have a class (ClassA) that inherits a class
(ClassB) which inherits System.Net.Mail .MailMessage

Project 1 references Project 2,
Project 2 references Project 3.

When I declare an instance of "ClassA" in a thrid project I get all of
the
public methods/properties that are in the System.Net.Mail .MailMessage
class,
but I do not get any of the public methods or properties that are
specirfically declared in Class B

Has anyone seen this before or could help me along in this situation?
Thanks...

I am using VS.NET 2005.
PROJECT 3
=========
Public MustInherit Class EmailMessage_Ba se

Inherits System.Net.Mail .MailMessage

Public Sub New()

mybase.new()

End Sub

Public Sub Test

End Sub

End Class

PROJECT 2
==========

Public Class EmailMessage

Inherits Project3.EmailM essage_Base

Public Sub New()

MyBase.New()

''''typing in me. brings up Test in the intellisense to the class at
least
knows it is there
End Sub

End Class

PROJECT 1
=========

Public Class Form1

Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As
System.EventArg s) Handles Button1.Click

Dim mail As New Project2.EmailM essage()

mail.From = New System.Net.Mail .MailAddress("s o*******@email. com")

mail.To.Add("te st")

mail.Bcc.Add("t e**@test.com")

mail.CC.Add("br **@psfdgfdgsfdg tran.comm")

mail.Subject = "sdfgs"

mail.Body = "testing"

mail.Test '<--------------Test does not show up in the list of methods
in
the intellisense
End Sub

End Class


Mar 28 '06 #5
In VB.NET 2005 Express Edition I get an error message stating I need a
reference to Project 1. The help states that this is needed to avoid ambiguity
in case the class is defined in more than one dll or assembly. I am not sure
what they mean by that, but prefer the error message over the strange
behaviour that was described.

Renze de Waal.
In article <11************ **********@j33g 2000cwa.googleg roups.com>,
to************* *@uniroma1.it wrote:
Looks like referencing is not "transitive " (like inheritance). It's
more just a matter of scope...
Perhaps since you had in mind the idea of inheritance you were kind of
extending it also to references, but as you have demonstrated, the idea
does not seem to apply...

D Witherspoon ha scritto:

Mar 28 '06 #6

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

Similar topics

6
2011
by: John | last post by:
I'm inheriting from multiple abstract base classes (2 to be exact). In the inherited class I want to know if I can implement two pure virtual methods (one from each base class) having the same name? An example is worth a thousand words (Note: I didn't check syntax but you will get this gist of it), so here it is .... class Base1 { virtual void action() = 0;
7
8661
by: Tron Thomas | last post by:
Under the right compiler the following code: class Base { public: virtual void Method(int){} }; class Derived: public Base {
7
6613
by: Baski | last post by:
Base class: class AssetBase { string _clli; public string CLLI { get
2
3957
by: DotNetShadow | last post by:
Hi Guys, I'm trying to work out how events work in VB.NET Basically I want to create a base class that has an Event. I would like all derived classes to inherit this event. I sorta worked out how to do that but the real problem I have is that If I have a base class with an event and derived class 1 and 2 inherit this event. Say derived class 1 creates a new derived class 2 how does this new class 2 get the same event as derived class 1...
7
1465
by: Graham Blandford | last post by:
OK, having answered my questions in a previous feed about pulling my derived class into the IDE.... Here's a new problem that I'm hoping can be fixed and isn't a .NET bug.... I have created an inherited class based on the textbox... which, all I am doing is allowing a forecolor to be set when .enabled is set to true. it works nicely, EXCEPT that when I click into the box, the font (set as default MS Sans 8.25pt) does not appear to be...
4
2435
by: Dennis | last post by:
I am trying to set the default design proerties in a control I have derived from the Panel Class. I thought I'd found how to do it from the MSDN but the following line doesn't work: Inherits System.Windows.Forms.Design.ControlDesigner I get an error saying that the Type is not defined. I cut and pasted all the imports and line from the MSDN. Would appreciate any help.
5
1236
by: D Witherspoon | last post by:
What is happening is that I have a class (ClassA) that inherits a class (ClassB) which inherits System.Net.Mail.MailMessage Project 1 references Project 2, Project 2 references Project 3. When I declare an instance of "ClassA" in a thrid project I get all of the public methods/properties that are in the System.Net.Mail.MailMessage class, but I do not get any of the public methods or properties that are specirfically declared in Class B
6
2487
by: Taran | last post by:
Hi All, I tried something with the C++ I know and some things just seem strange. consider: #include <iostream> using namespace std;
26
5354
by: nyathancha | last post by:
Hi, How Do I create an instance of a derived class from an instance of a base class, essentially wrapping up an existing base class with some additional functionality. The reason I need this is because I am not always able to control/create all the different constructors the base class has. My problem can be described in code as follows ... /* This is the base class with a whole heap of constructors/functionality*/ public class Animal
0
8330
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
8850
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
8523
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
7355
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
6178
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
5649
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
4175
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
4334
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2749
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

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.