Static Class and Variable 
Author Message
 Static Class and Variable

Hi,

I'm confused with Static Class, and Static Variable in a Class, can anyone
help me out that what's the scope of varible inside a static class and
static varible inside a non-static class, and are both of them thread-safe?

Many thanks,
Michael



Wed, 17 Aug 2005 07:19:04 GMT  
 Static Class and Variable

Quote:
> I'm confused with Static Class, and Static Variable in a Class,
> can anyone help me out that what's the scope of varible inside a
> static class and static varible inside a non-static class, and
> are both of them thread-safe?

What is a static class? I only know static members that are calle Shared in
VB. I can't tell you something about the scope. Shared members exist once
per class, no matter how many instances of the class have been created.
Lifetime of shared members is as long as the assembly containing the shared
members is loaded, i.e. usually from the start to the end of the
application. Accessibility depends on the modifier used for declaration
(public/private/friend). To access a shared member, VB's name resolution
mechanism applies. That depends on from where you want to access it, which
qualifier is used and which Imports statement are included. More:

ms-help://MS.VSCC/MS.MSDNVS/vbcn7/html/vbconNamesCharacteristics.htm
ms-help://MS.VSCC/MS.MSDNVS/vbls7/html/vblrfVBSpec4_7_1.htm

Armin



Thu, 18 Aug 2005 02:29:34 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Static Variables in Classes

2. Static variable not static enough ???

3. static classes and methods

4. creating static classes?

5. Static class data

6. Static class module in VBA

7. Static class attributes, how to create them.

8. Class Side (Static) functions

9. Static class membervariables?

10. C++ static class property possible in VB ?

11. Static class members

12. static class data in ActiveX DLLs?

 

 
Powered by phpBB® Forum Software