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

Accessing object without instanciate it???

Dear all,

what is the way to declare an object, that when it is use,
we do not need to instance it by the new keyword.

Similar way as the Trace and Debug class.

I have made a class which handle user message error and
loging, and would like to get that object to be access
like :

MessageProvider.Display()

instead of

dim myMessageProvider as new MessageProvider
myMessageProvider.Display()

thnaks for your help
Jul 21 '05 #1
1 1248
serge calderara <se*************@maillefer.net> wrote:
what is the way to declare an object, that when it is use,
we do not need to instance it by the new keyword.

Similar way as the Trace and Debug class.

I have made a class which handle user message error and
loging, and would like to get that object to be access
like :

MessageProvider.Display()

instead of

dim myMessageProvider as new MessageProvider
myMessageProvider.Display()


You need to make your method static (shared in VB.NET).

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Jul 21 '05 #2

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

Similar topics

1
by: hml | last post by:
Hi, I have a "legacy" system (namely, vst audio plugins) which calls me through a mixed-mode, managed c++ library with a call similar to : void process(float *input,int inputLength) inside...
3
by: Alex | last post by:
I'm having a problem porting an ASP solution to ASPX. In the ASP solution I'm accessing a DCOM server, create sub DCOM objects and call functions from VB script on the ASP pages. The DCOM object...
9
by: Ric | last post by:
im new to asp.net. please help if u can. is it possible to refer to a control(ie lable, placeholder, textbox) that is inside a repeater object from a code behind file? when i place the control...
1
by: serge calderara | last post by:
Dear all, what is the way to declare an object, that when it is use, we do not need to instance it by the new keyword. Similar way as the Trace and Debug class. I have made a class which...
15
by: Sam Kong | last post by:
Hello! I got recently intrigued with JavaScript's prototype-based object-orientation. However, I still don't understand the mechanism clearly. What's the difference between the following...
0
by: sonu | last post by:
I have following client side code which i have used in my asp.net project SummaryFeatured Resources from the IBM Business Values Solution Center WHITEPAPER : CRM Done Right Improve the...
3
by: R.Kaiser | last post by:
In a VS2005 Windows Forms Application I have an ordinary class like class C{ int x; public: C(int x_):x(x_) { } void display() { // Here I want to access a TextBox Form member //...
7
by: Guillaume BRAUX | last post by:
Hello, I am looking for a way to create a method that will be available to other classes in my project, but without needing to instanciate the class. I don't want this method to be static (il...
6
by: Ritesh Raj Sarraf | last post by:
Hi, I've been very confused about why this doesn't work. I mean I don't see any reason why this has been made not to work. class Log: def __init__(self, verbose, lock = None): if verbose...
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: 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
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...

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.