473,395 Members | 1,679 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,395 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 1094
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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,...
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...

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.