By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,815 Members | 1,143 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,815 IT Pros & Developers. It's quick & easy.

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

P: n/a
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_Base

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.EmailMessage_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(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click

Dim mail As New Project2.EmailMessage()

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

mail.To.Add("test")

mail.Bcc.Add("te**@test.com")

mail.CC.Add("br**@psfdgfdgsfdgtran.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
Share this Question
Share on Google+
5 Replies


P: n/a
Putting the whole thing into a file, works... Perhaps a reference
(1->3) is missing...
Let me know...

-tom

----------------
Public MustInherit Class EmailMessage_Base
Inherits System.Net.Mail.MailMessage

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

Public Sub Test()
End Sub

End Class

Public Class EmailMessage
Inherits EmailMessage_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
Public Class Form1

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click

Dim mail As New EmailMessage()

mail.From = New
System.Net.Mail.MailAddress("someem...@email.com")
mail.To.Add("test")
mail.Bcc.Add("t...@test.com")
mail.CC.Add("b...@psfdgfdgsfdgtran.comm")
mail.Subject = "sdfgs"
mail.Body = "testing"
mail.Test() '<--------------Test does not show up in the list
of methods in
'the(intellisense)

'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_Base

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.EmailMessage_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(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click

Dim mail As New Project2.EmailMessage()

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

mail.To.Add("test")

mail.Bcc.Add("te**@test.com")

mail.CC.Add("br**@psfdgfdgsfdgtran.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

P: n/a
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_Base

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.EmailMessage_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(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click

Dim mail As New Project2.EmailMessage()

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

mail.To.Add("test")

mail.Bcc.Add("te**@test.com")

mail.CC.Add("br**@psfdgfdgsfdgtran.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

P: n/a
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.netNoSpamM> wrote
in message news:02**********************************@microsof t.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_Base

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.EmailMessage_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(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click

Dim mail As New Project2.EmailMessage()

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

mail.To.Add("test")

mail.Bcc.Add("te**@test.com")

mail.CC.Add("br**@psfdgfdgsfdgtran.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

P: n/a
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.netNoSpamM> wrote
in message news:02**********************************@microsof t.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_Base

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.EmailMessage_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(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click

Dim mail As New Project2.EmailMessage()

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

mail.To.Add("test")

mail.Bcc.Add("te**@test.com")

mail.CC.Add("br**@psfdgfdgsfdgtran.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

P: n/a
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**********************@j33g2000cwa.googlegroups .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 discussion thread is closed

Replies have been disabled for this discussion.