VB GlobalMultise Class

G

Gonçalo Boléo

Can i have in C# classes that are like VB6 classes GlobalMultiUse?
I have a class with general functions supporting my programming and i don't
wan't to instanciate it in every class that i need to use it.

thanks,
Gonçalo Boléo
 
R

Rob Teixeira

Mark the functions with the "static" keyword.
To call them, use ClassName.FunctionName
No instance required. Technically, this is a little different from
GlobalMultiUse since COM requires instances and under the covers it's not
quite the same, but the end effect is what you're looking for.

-Rob Teixeira
 
M

Michael C

Rob Teixeira said:
Mark the functions with the "static" keyword.
To call them, use ClassName.FunctionName
No instance required. Technically, this is a little different from
GlobalMultiUse since COM requires instances and under the covers it's not
quite the same, but the end effect is what you're looking for.

It can be a good idea to mark the constructor of this class as private.

Michael
 
G

Gonçalo Boléo

Thanks
I think this is what i want

Rob Teixeira said:
Mark the functions with the "static" keyword.
To call them, use ClassName.FunctionName
No instance required. Technically, this is a little different from
GlobalMultiUse since COM requires instances and under the covers it's not
quite the same, but the end effect is what you're looking for.

-Rob Teixeira
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top