473,320 Members | 1,993 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,320 software developers and data experts.

Class Reference Problem

I have a class within a class and need to use a method in the main class like:

Public Class myMainClass
Public Sub mySubToDoSomething ()
.....
End Sub

Friend Class mySubClass
myMainClass.mySubToDoSomething() 'Get Error Here
End Class

End Class
--
When I build the solution, I get an error saying the myMainClass is Ambiguous
How do I use the mySubToDoSomething in the mySubClsss?

Dennis in Houston
Nov 21 '05 #1
3 1092
Something like this maybe?

Public Class Test

Public Sub Testsub()

End Sub

Friend Class subTest

Public Sub New()

Dim T As New Test

T.Testsub()

End Sub

End Class

End Class

"Dennis" <De****@discussions.microsoft.com> wrote in message
news:52**********************************@microsof t.com...
I have a class within a class and need to use a method in the main class like:
Public Class myMainClass
Public Sub mySubToDoSomething ()
.....
End Sub

Friend Class mySubClass
myMainClass.mySubToDoSomething() 'Get Error Here
End Class

End Class
--
When I build the solution, I get an error saying the myMainClass is Ambiguous How do I use the mySubToDoSomething in the mySubClsss?

Dennis in Houston

Nov 21 '05 #2
Thanks Chris. I found my problem. What I had done was add the project to my
solution (which was a user control) and also added a reference to the
project's DLL file which created confusion on the part of the compiler. It
wasn't sure whether to use the enums and classes in the added project or the
referenced DLL.

"Chris Smith" wrote:
Something like this maybe?

Public Class Test

Public Sub Testsub()

End Sub

Friend Class subTest

Public Sub New()

Dim T As New Test

T.Testsub()

End Sub

End Class

End Class

"Dennis" <De****@discussions.microsoft.com> wrote in message
news:52**********************************@microsof t.com...
I have a class within a class and need to use a method in the main class

like:

Public Class myMainClass
Public Sub mySubToDoSomething ()
.....
End Sub

Friend Class mySubClass
myMainClass.mySubToDoSomething() 'Get Error Here
End Class

End Class
--
When I build the solution, I get an error saying the myMainClass is

Ambiguous
How do I use the mySubToDoSomething in the mySubClsss?

Dennis in Houston


Nov 21 '05 #3
Thanks Chris. I found my problem. What I had done was add the project to my
solution (which was a user control) and also added a reference to the
project's DLL file which created confusion on the part of the compiler. It
wasn't sure whether to use the enums and classes in the added project or the
referenced DLL.

"Chris Smith" wrote:
Something like this maybe?

Public Class Test

Public Sub Testsub()

End Sub

Friend Class subTest

Public Sub New()

Dim T As New Test

T.Testsub()

End Sub

End Class

End Class

"Dennis" <De****@discussions.microsoft.com> wrote in message
news:52**********************************@microsof t.com...
I have a class within a class and need to use a method in the main class

like:

Public Class myMainClass
Public Sub mySubToDoSomething ()
.....
End Sub

Friend Class mySubClass
myMainClass.mySubToDoSomething() 'Get Error Here
End Class

End Class
--
When I build the solution, I get an error saying the myMainClass is

Ambiguous
How do I use the mySubToDoSomething in the mySubClsss?

Dennis in Houston


Nov 21 '05 #4

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

Similar topics

4
by: cppaddict | last post by:
Hi, Is it possible that class A references class B, and class B references class A? Specifically, here is my problem. I have a card table class (Table), which represents a table at which...
4
by: Chuck Ritzke | last post by:
I keep asking myself this question as I write class modules. What's the best/smartest/most efficient way to send a large object back and forth to a class module? For example, say I have a data...
166
by: Graham | last post by:
This has to do with class variables and instances variables. Given the following: <code> class _class: var = 0 #rest of the class
21
by: Mark Broadbent | last post by:
Consider the following statements //------- Item i = Basket.Items; //indexer is used to return instance of class Item Basket.Items.Remove(); //method on class item is fired item i = new...
4
by: Peter Speybrouck | last post by:
I have a little problem with a webservice. I reproduced the problem in the following simplified example. I just create a new C# ASP.NET webservice and a c# console application. I added a new...
12
by: scottt | last post by:
hi, I am having a little problem passing in reference of my calling class (in my ..exe)into a DLL. Both programs are C# and what I am trying to do is pass a reference to my one class into a DLL...
3
by: Ross McLean | last post by:
Hi all, I've been teaching myself C# for a new project at work. I have a bit of a background in c++ and java but never been what you could call a guru. I'm having some strange things happening...
19
by: Chocawok | last post by:
Some of the classes in my app are graphical. To encapsulate the graphical side of things I had created a class called "sprite" which holds a bit map and knows how to draw itself etc. The...
8
by: nishit.gupta | last post by:
I was having a problem with template class memer function definition , so i serched the net and find that template class member fuction definition should be in header file else compilation will...
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...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.