Peter said:
Hi Mythran,
Can you explain the effect of your coding? I'm quite new to VB.net coding.
Thanks,
Peter
Essentially, what I was doing was creating a Module out of a class.... The
first example given above creates a class with a static/shared constructor.
The first time an operation calls a shared method, shared property, or
shared member of the Test class, the Shared constructor is called to
instantiate the shared class. The shared class is, and I'm not 100% sure on
the internal implementations of .Net, a special single instance created in
memory for the AppDomain that is calling it. The single instance is only
destroyed once the AppDomain is unloaded, and the single instance can not be
replaced in the AppDomain. So, it is basically, if not exactly, the same
thing as a module. The only difference is, modules use different keywords
and you don't have to specified Shared on every method you want exposed.
I may be explaining this all wrong, but for me, putting my thoughts into
words is hard work! Now, putting my thoughts in an application, that's what
I get paid for!
HTH,
Mythran