Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Programming question (class related) 1

Status
Not open for further replies.

Joekel3

Technical User
Feb 26, 2004
13
US
related to programming approaches, is it better to start out looking to make your own classes with the class builder in vb 5.0 or to see if a class already exists that you could use for a project?
I am haveing difficulty with the concept of using classes in a application. Is it possible to import an existing class? Is there any way to find out all the available classes and types that come with the professional version of vb 5.0, short of checking the references of all and looking through them in the object browser?
Feel free to point to any other available information that you think would be helpful for me, and thank you in advance for any help you can give.
Joe
 
You sure you don't want to post this in the VB.NET forum?
I don't think VB 5&6 concern themselves with classes.
 
Classes are NOT just for VB.NET.

You will have to create your own classes. If you have not ever done this then the class builder is a good place to start to familiarize yourself with them. They are most useful when creating ActiveX Dll's and provide a way to program in an object oriented approach.
 


Also, you might find some info on MSDN and doing a google search for it, Try looking into COM objects as well, this is where they become very useful.
 
Thanks for your responces,
I am obviously new to the class concept but I have purchased both Visual Basic 5.0 and Visual C++ 2003 .net and I was kind of useing VB with its class builder to try to learn the use of classes in C++.
Is there an important relationship between the classes that I create and the Collection class that I would also create that is mentioned in the documentation, "Online Books".
What is the purpose of an ActiveX Dll? Are they used as add ons to existing software package? Feel free to elaborate if you could please. I have read through almost the whole documentation and am beginning to get a grasp but am having difficulty with the use of the class. classes relate to types and are the core that the application is built around, is this true? Properties deal with the traits of the object, Methods are the ways the object accesses and or does something to the object and events are conditions that happen because of a change to the object. Is this close?
Thanks again for the help.
Joe
 
A dll is a way to consolidate methods, functions and properties to a specific object. Example- A Animal.DLL can
contain objects specifying a particular animal, like cat, dog, cow. Each of these objects(classes) may have properties that pertain only to a specific animal.

Think of a class as an object. A dll can have lots of objects. The windows operating system is practically built
with Dll's.
C++ is more powerful for creating objects in the sense that it supports inheritance. VB5/6 does not support this but will support polymorphism. I would suggest finding a book or site that tutors in the use of object oriented programming using VB and maybe one for C++.
 
>I don't think VB 5&6 concern themselves with classes

Oh dear...
 
I would highly recommend a book published by WROX Press. The title I bought several years ago was called Professional Visual Basic 5.0 Business Objects and was written by Rockford Lhotka. I too was having difficulty grasping the concept of classes/objects but after reading just a few pages, the light went on. You may find newer versions of the same book (VB 6.0, .Net) but the concepts remain the same.
 
jjames,
Thank you for your suggestion. I just purchased a used copy for $6.76 including shipping from Barnes & Noble (bn.com) used and out of print book web site. I figured what the heck I've wasted more money than that in time reading the books online over and over again.
Looking forward to the lights coming on!!!
Thanks,
Joe
 
jjames
I got the book last week and have been reading it. Do you still have your copy so that I could ask you a question. I am confused.
Thanks,
Joe
 
jjames,
I was confused by a couple of things in chapter 3. I went thru and entered the program text on pages 90-92 but was confused as to which class belonged to which project. This caused me to be confused as to asigning references. I believe I have this straightened out now. However, one thing that still has me scratching my head is the following text on page 92 "if you run the sample program as it stands, you won't see much happen: but if you step through the program execution, you'll see the callback mechanism alive and well." I tried this with both the local window on and by pressing f8 and I didn't see anything at all.
Before you go through and try to duplicate my confused state, see if you could just read through that little section (page 90-94) and tell me if the point behind this exercise was to point out the benefit of Visual Basic 5.0's new addition of the three key words that allow you to create your own events.
Is this the point or am I missing it completely?
Thanks,
Joe
ps feel free to elaborate on anything you think is important to my catching on to this. I have found this book to be very interesting so far. I had no idea that this would be so theoretical. That first chapter is excellent in explaining the big picture. Thanks again for suggesting this book!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top