class module vs. module 
Author Message
 class module vs. module

hi, everyone.
anyone know what's the difference between class module and module????
thanks for your answer!! ^^


Thu, 29 Apr 2004 17:56:54 GMT  
 class module vs. module
Class modules can be instanced and can implement interfaces, as well as
using properties. Modules do none of those things.


Quote:
> hi, everyone.
> anyone know what's the difference between class module and module????
> thanks for your answer!! ^^



Sat, 01 May 2004 01:50:42 GMT  
 class module vs. module


Quote:
> hi, everyone.
> anyone know what's the difference between class module and module????
> thanks for your answer!! ^^

I've been wondering that for a while.
I think its something to do with heirarchy in VB
Like a Class Module is higher up/more functions than a normal module.
But im not sure.


Sat, 01 May 2004 02:20:25 GMT  
 class module vs. module
Want something more detailed than my post, email me


Quote:
> hi, everyone.
> anyone know what's the difference between class module and module????
> thanks for your answer!! ^^



Sat, 01 May 2004 02:53:31 GMT  
 class module vs. module


Quote:
> Class modules can be instanced and can implement interfaces, as well as
> using properties. Modules do none of those things.

In English, please :-)


Sat, 01 May 2004 03:51:14 GMT  
 class module vs. module

Quote:

> hi, everyone.
> anyone know what's the difference between class module and module????
> thanks for your answer!! ^^

Lucky,
F1 is there for a reason!!!  Try it next time.
Search on
Class Modules vs. Standard Modules
That will give you a start.
Neila


Sat, 01 May 2004 05:39:38 GMT  
 class module vs. module
Hi,

Module - will load only one time (during execution)
Class Module - you can load/unload based upon requirement

Sivan Velappan Pillai

Quote:

> hi, everyone.
> anyone know what's the difference between class module and module????
> thanks for your answer!! ^^



Sat, 01 May 2004 06:51:05 GMT  
 class module vs. module
A class module lets you create your own objects. F'rinstance, you may write
a class module to define an Employee class and establish the properties
(i.e., name, address, salary, etc) and methods (i.e. Hire, fire, promote,
etc) you wish to use. You can then create an employee object in your main
code and access the properties and methods just as you do with other
objects. In general, when you program a class module, you are programming
for the application programmer, not for the user. The application programmer
can then use the class module when writing the application. You may be both
programmer's, but the class module is completely invisible to the end user.
There is (or should be) absolutely no user interface.

A standard module is generally a code-only module that allows you to do a
variety of general tasks such as things that need to be done when an
application first starts up or just before it shuts down, or you can
establish global items. For example, one common use is to establish a
persistent connection to a database in a standard module which is then
available to all of the forms, classes and so forth in an application. Or it
is sometimes used to establish a number of global constants that will be
used in various places throughout the application.

This isn't complete by a long shot, but I hope it helps clarify some of the
differences.

Jim


Quote:
> hi, everyone.
> anyone know what's the difference between class module and module????
> thanks for your answer!! ^^



Sat, 01 May 2004 09:54:28 GMT  
 class module vs. module
James is correct.

Class modules are used whenever object oriented programming is involved. It
has many advantages and is, in my oppinion, the only way to develop software
solutions.

I can recommend Peter Wrights book Beginning VB 6 Object if you want to
learn
how to develop robust OO software solutions.

Michael


Quote:
> hi, everyone.
> anyone know what's the difference between class module and module????
> thanks for your answer!! ^^



Sat, 01 May 2004 17:05:43 GMT  
 class module vs. module
James is correct.

Class modules are used whenever object oriented programming is involved. It
has many advantages and is, in my oppinion, the only way to develop software
solutions.

I can recommend Peter Wrights book Beginning VB 6 Object if you want to
learn
how to develop robust OO software solutions.

Michael



Quote:
> A class module lets you create your own objects. F'rinstance, you may
write
> a class module to define an Employee class and establish the properties
> (i.e., name, address, salary, etc) and methods (i.e. Hire, fire, promote,
> etc) you wish to use. You can then create an employee object in your main
> code and access the properties and methods just as you do with other
> objects. In general, when you program a class module, you are programming
> for the application programmer, not for the user. The application
programmer
> can then use the class module when writing the application. You may be
both
> programmer's, but the class module is completely invisible to the end
user.
> There is (or should be) absolutely no user interface.

> A standard module is generally a code-only module that allows you to do a
> variety of general tasks such as things that need to be done when an
> application first starts up or just before it shuts down, or you can
> establish global items. For example, one common use is to establish a
> persistent connection to a database in a standard module which is then
> available to all of the forms, classes and so forth in an application. Or
it
> is sometimes used to establish a number of global constants that will be
> used in various places throughout the application.

> This isn't complete by a long shot, but I hope it helps clarify some of
the
> differences.

> Jim



> > hi, everyone.
> > anyone know what's the difference between class module and module????
> > thanks for your answer!! ^^



Sat, 01 May 2004 17:06:17 GMT  
 class module vs. module
On Sun, 11 Nov 2001 17:56:54 +0800, "-=Lucky~^.^"

Quote:

>hi, everyone.
>anyone know what's the difference between class module and module????
>thanks for your answer!! ^^

A normal module (.BAS) is a chunk of code that is available to all
other parts of an App - there is only one instance of it.
It can (interestingly) have properties, but cannot raise events.

You can send the AddressOf Subs/Function in a .BAS module

A Class module (.CLS) is like a Form (.FRM) without a graphical
interface - you can create multiple instances of it, and it can raise
events.
You cannot use AddressOf to send the address of a Sub/Function in a
Class module.

A Class module also has an Initialize and a Terminate event



Sat, 01 May 2004 18:03:16 GMT  
 class module vs. module
thx a lot!! ^^



Quote:
> > hi, everyone.
> > anyone know what's the difference between class module and module????
> > thanks for your answer!! ^^

> Lucky,
> F1 is there for a reason!!!  Try it next time.
> Search on
> Class Modules vs. Standard Modules
> That will give you a start.
> Neila



Sat, 01 May 2004 13:48:15 GMT  
 class module vs. module
i take it you mean that if i used a class module, i could code it to draw
its own form, instead of needing one already?

the code i mean is when you print the form out as code, that code can be
inputted into the class module to make it.


Quote:
> A class module lets you create your own objects. F'rinstance, you may
write
> a class module to define an Employee class and establish the properties
> (i.e., name, address, salary, etc) and methods (i.e. Hire, fire, promote,
> etc) you wish to use. You can then create an employee object in your main
> code and access the properties and methods just as you do with other
> objects. In general, when you program a class module, you are programming
> for the application programmer, not for the user. The application
programmer
> can then use the class module when writing the application. You may be
both
> programmer's, but the class module is completely invisible to the end
user.
> There is (or should be) absolutely no user interface.

> A standard module is generally a code-only module that allows you to do a
> variety of general tasks such as things that need to be done when an
> application first starts up or just before it shuts down, or you can
> establish global items. For example, one common use is to establish a
> persistent connection to a database in a standard module which is then
> available to all of the forms, classes and so forth in an application. Or
it
> is sometimes used to establish a number of global constants that will be
> used in various places throughout the application.

> This isn't complete by a long shot, but I hope it helps clarify some of
the
> differences.

> Jim



> > hi, everyone.
> > anyone know what's the difference between class module and module????
> > thanks for your answer!! ^^



Sun, 02 May 2004 03:44:49 GMT  
 class module vs. module
Urm, no

(Apologies now if I make this sound more complicated - I know what I'm
trying to say!!)

Take a form..  a form is just a Class Module but with a user interface. It
has properties, such as left, top, width height etc. It also has methods
such as Refresh.

Take a human being - they have properties such as age, height, sex and
methods such as talk, walk, smile.

Class Modules are often used in VB to represent real life things, such as a
customer (a human being, sometimes!!), who would have properties like age,
sex, credit balance etc. and methods like InvoiceCustomer.

One of the programmers in a team might be responsible for writing the code
that makes up a customer and the code that goes behind the age and sex
properties - he'd then allow the other programmers in the team to use the
class - the other programmers would then only see the properties and the
methods - they wouldn't care how the age is worked out, or how the hell to
invoice a customer.

Just like an integer, you can also DIM lots of the same class module e.g

    Dim clsFred as New clsCustomer
    Dim clsJoe as New clsCustomer
    Dim clsPat as New Customer

    clsFred.Age = 21
    clsFred.Sex = "M"
    clsJoe.Age = 45
    clsJoe.Sex = "M"
    clsPat.Age = 28
    clsPat.Sex = "F"

I also use classes to help me bundle code that I use in lots of different
places - for example, I have a class that helps me talk to my product
database. For example, instead of writing this everytime I want product
details

    Dim cnDBConnection as New ADODB.Connection
    Dim rstProduct as New ADODB.Recordset
    rstProduct.Open "Select * from Product where ProdCode =
301112",cnDBConnection,ADOpenForwardOnly, ADLockReadOnly

I write this now as

    Dim clsProdDB as New clsProductDatabaseRoutines
    Dim rstProduct as ADODB.Recordset

    Set rstProduct = clsProdDB.GetProductDetails(301112)

It may not look like a lot of difference, a few keystrokes less you may
think, but the bottom example has the advantage that if I change the class
routine for GetProductDetails all of my programs that use
clsProductDatabaseRoutines see the change automatically. I don't have to
remember to change lots of code, which means less bugs and less retyping
(which is boring).

I hope this helps.

Eddie


Quote:
> i take it you mean that if i used a class module, i could code it to draw
> its own form, instead of needing one already?

> the code i mean is when you print the form out as code, that code can be
> inputted into the class module to make it.



> > A class module lets you create your own objects. F'rinstance, you may
> write
> > a class module to define an Employee class and establish the properties
> > (i.e., name, address, salary, etc) and methods (i.e. Hire, fire,
promote,
> > etc) you wish to use. You can then create an employee object in your
main
> > code and access the properties and methods just as you do with other
> > objects. In general, when you program a class module, you are
programming
> > for the application programmer, not for the user. The application
> programmer
> > can then use the class module when writing the application. You may be
> both
> > programmer's, but the class module is completely invisible to the end
> user.
> > There is (or should be) absolutely no user interface.

> > A standard module is generally a code-only module that allows you to do
a
> > variety of general tasks such as things that need to be done when an
> > application first starts up or just before it shuts down, or you can
> > establish global items. For example, one common use is to establish a
> > persistent connection to a database in a standard module which is then
> > available to all of the forms, classes and so forth in an application.
Or
> it
> > is sometimes used to establish a number of global constants that will be
> > used in various places throughout the application.

> > This isn't complete by a long shot, but I hope it helps clarify some of
> the
> > differences.

> > Jim



> > > hi, everyone.
> > > anyone know what's the difference between class module and module????
> > > thanks for your answer!! ^^



Wed, 05 May 2004 07:33:56 GMT  
 
 [ 14 post ] 

 Relevant Pages 

1. Q: Code Module vs UserControl (Form, Class) module.

2. Class Module vs Module

3. Q: Code Module vs UserControl (Form, Class) module.

4. Class Module vs. REgular Module

5. Q: Code Module vs UserControl (Form, Class) module.

6. Modules vs. Class Modules

7. Class modules 97 - Refering to array within a custom class module

8. Accessing procedures of a class module from another class module

9. Circular Reference Between Modules when 2 Class Modules Listen to Each others Events

10. Class Module and Module

11. Class Modules & Modules

12. VB Modules/Class Modules

 

 
Powered by phpBB® Forum Software