473,395 Members | 1,554 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.

Shared Methods in VB 2005 Beta 2

Is there anyway to access a Shared method from within an instance of a
class.

public class MyClass
Shared Readonly Property myProp() as string
Get
return "MyProp Example"
End Get
End Property
end class

I want to use this as:

dim mc as new MyClass
debug.print mc.myProp

and

debug.print MyClass.myProp

Thanks,
Mike Ober.

Nov 21 '05 #1
3 880
"Michael D. Ober" <mdo.@.wakeassoc..com> schrieb:
Is there anyway to access a Shared method from within an instance of a


"My Project" -> "Compile" -> "Instance variable accesses shared member" ->
"None".

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #2

Thanks - After looking at this and then looking up exactly what this error
is about, I have modified my class to not use the Shared properties to
comply with the .NET programming model.

Mike.

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:ul**************@TK2MSFTNGP12.phx.gbl...
"Michael D. Ober" <mdo.@.wakeassoc..com> schrieb:
Is there anyway to access a Shared method from within an instance of a


"My Project" -> "Compile" -> "Instance variable accesses shared member" ->
"None".

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>


Nov 21 '05 #3
Turns out Public Const is what I actually need.

Mike.

"Michael D. Ober" <obermd.@.alum.mit.edu.nospam> wrote in message
news:Xw*****************@newsread1.news.pas.earthl ink.net...

Thanks - After looking at this and then looking up exactly what this error
is about, I have modified my class to not use the Shared properties to
comply with the .NET programming model.

Mike.

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:ul**************@TK2MSFTNGP12.phx.gbl...
"Michael D. Ober" <mdo.@.wakeassoc..com> schrieb:
Is there anyway to access a Shared method from within an instance of a


"My Project" -> "Compile" -> "Instance variable accesses shared member" -> "None".

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>



Nov 21 '05 #4

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

Similar topics

8
by: Dan Perl | last post by:
Here is a problem I am having trouble with and I hope someone in this group will suggest a solution. First, some code that works. 3 classes that are derived from each other (A->B->C), each one...
48
by: ik | last post by:
ERROR after uninstalling SQL Server 2005 Express I get this message, SQLDMO has not been registered. Please re-run your setupand contact your system administrator. GREAT!!! ReInstalled SQL...
10
by: John Brock | last post by:
I have a base class with several derived classes (I'm writing in VB.NET). I want each derived class to have a unique class ID (a String), and I want the derived classes to inherit from the base...
2
by: Trevor Oakley | last post by:
I am writing thousands of html pages from an MS SQL source using a DataSet and then an XslTransform. I have an interest in making the code run faster as it takes several minutes (sometimes ten...
3
by: Mike P | last post by:
I've been using Visual Studio 2005 Beta 1 for the last few weeks, and I now want to try using SQL Server 2005 Beta with it. I've been to the Microsoft URL...
7
by: Mark Kamoski | last post by:
Hi Everyone-- Please help. What are the implications, (in terms of memory, application footprint, resource use, threading, and so forth), of using Shared methods? These Shared classes raise...
3
by: Chris Welch | last post by:
I'm developing my company's new site in Visual Studio 2005 (Beta 2) and I'm wondering if anyone knows if there is a way to set the default namespace of the Web project. I can't find it in the Web...
33
by: Joe Fallon | last post by:
1. I have a Base class that has a certain amount of functionality. 2. Then I have a CodeSmith generated class that inherits from the Base class and adds functionality. 3. Since I want to be able...
7
by: Random.Coder | last post by:
The output of this simple program below differs if it's compiled in Visual Studio 2005 and 2008. Is one the correct output, and if so, why? using System; namespace DerivedTestApp { class...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...
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...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.