AddIn - ObjectDev. A Class Building Addin

screen-shot

Introduction:

This whole project began because of my utter loathing for Visual Basic’s Class Builder utility. I spent long amounts of time creating COM objects with repetitive coding. I also became interested in VB add-ins. I then decided to write my own Class Builder utility. I named it ObjectDev because it helps you develop objects. ObjectDev requires a knowledge of COM both to use it and to understand its code. I hope you find ObjectDev a useful and informative tool.

What ObjectDev Does:

ObjectDev allows the user to specify any number of subs, functions, and properties. If Create Interface is selected, ObjectDev then generates an interface and an object which implements the interface. If Create Interface is not selected, then ObjectDev creates an object with no interface. If Persistable is selected, code is added to the ReadProperties and WriteProperties functions which enables persistence. If IsDirty is selected, a property let/get and a boolean is added to the objects. When a property is changed, the IsDirty boolean changes to True. ObjectDev will cut hours off the time required to create components for your program.

MGlobals:

When I first began designing ObjectDev, I noticed that if you show another form, the variables on the original form do not hold their values. The best way around this problem was to create global variables to hold the information.

CPrefixes:

Since I wanted ObjectDev to be flexible, I decided to allow the prefixes on all variables to be changed. Since I allowed this changing, I needed something to hold the prefixes, and CPrefixes was born. CPrefixes is just a straightforward object that does nothing but hold data.

CProperty and CPropertyCollection:

In order to store the properties created by the user, I wrote an object/collection. The properties/functions of CProperty are detailed below. The collection is self-explanatory.

  • PropName - the name of the property

  • ReturnType - enumeration of the type of the property (i.e. string, variant, etc.)

  • Style - specifies if the property is Let/Get, Set/Get, Get (an object), or Get

  • RetAsStr - returns a string with the ReturnType spelled out (i.e. “string”, “variant”, etc)

  • VarName - returns the name of the property’s variable (i.e. ByVal sName as String) if you pass True, then either ByVal or ByRef is added on the front

  • ByType - specifies if the property’s variable is passed ByRef or ByVal

 

CSubFunction and CSubFunctionCollection:

In order to store the subs/functions created by the user, I wrote these objects. The properties/functions of CProperty are detailed below. The collection is self-explanatory.

  • Arguments - holds the arguments collection for this sub/function (see the doc on CArgument and CArgumentCollection)

  • IsPrivate - specifies if the sub/function is private or public

  • RetAsStr - returns a string with the function return type spelled out (i.e. “string”,“variant”, etc.)

  • ReturnType - an enum which specifies the function return type

  • SubName -the name of the sub/function which will be written in code

 

CArgument and CArgumentCollection:

In order to store the arguments of each subs/function created by the user, I wrote these objects. The properties/functions of CProperty are detailed below. The collection is self-explanatory.

  • ArgName - the name of the argument which will be written to code

  • ArgOptional - specifies if the argument is optional or not

  • ArgType - the type of the argument (i.e. string, variant, etc.)

  • ByType - specifies if the argument is passed ByVal or ByRef

  • ByTypeAsString - returns “ByVal” or “ByRef” depending on what ByType is

  • TypeAsString - returns a string with the argument type (i.e. FuncName As String, FuncName As Variant, etc.)

 

Legal Garbage:

I developed this add-in for my personal growth as a Visual Basic developer. I also feel that programmers should help each other out as much as possible. Therefore, I really do not care what you do with this code. I would prefer that you just not compile my code and show everyone this wonderful add-in you created, but you can. If you improve my code, I would appreciate if you give me some credit, but you do not have to. Also, if you improve on my code, I would like you to send your code to me (pclogic15@hotmail.com). In short, you can do whatever you want to with my code. You do not have to give me any compensation or recognition.

Conclusion:

I hope you either learn from ObjectDev, find it useful, or both. I would appreciate your comments. Also, I would appreciate a quick email if you find something wrong. Please send all emails to pclogic15@hotmail.com.

Download Zipped Project File (30k)



Comments

  • Add.Ins

    Posted by Legacy on 05/30/2003 12:00am

    Originally posted by: Nanda


    Good
    I wish u can perform Excelent task..
    bye at the movement...
    Nanda

    Reply
  • Nice Stuff

    Posted by Legacy on 05/18/2003 12:00am

    Originally posted by: Edward Wittlinger

    To Whom It May Concern:

    I will pass this onto my development team and see if we can use this utility. I would like for you, to get back with me if you have more documentation on this project.

    Edward Wittlinger - Chief Software Architect
    Ewittlinger@sawmillsoftware.com
    www.Sawmillsoftware.com

    Reply
  • son thuan

    Posted by Legacy on 09/25/2002 12:00am

    Originally posted by: son thuan

    thank for supporting me !

    Reply
  • Great!

    Posted by Legacy on 09/21/2002 12:00am

    Originally posted by: Rod Mason

    I like to see VB developers create useful tools.
    If you develope any more please let me know.
    -Rod Mason

    Reply
  • rockin dude

    Posted by Legacy on 08/02/2001 12:00am

    Originally posted by: testure

    yeah I hate the class builder in vb6..so this is great :)
    good work!

    Reply
  • Nice

    Posted by Legacy on 05/21/2001 12:00am

    Originally posted by: c.cheese

    Very nice!

    Reply
  • Thanxxx

    Posted by Legacy on 05/18/2001 12:00am

    Originally posted by: Erik

    Handy timersaver !

    Reply
  • Thanks...

    Posted by Legacy on 03/26/2001 12:00am

    Originally posted by: CoolDaddy

    I was just as frustrated as you were with the CBU of VB and was looking to do something similar. I then ran acrooss this bit of code which gave me an additional head start.

    THANKS!!!

    p.s. Ignore the thanks in CBGB

    Reply
Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • Java developers know that testing code changes can be a huge pain, and waiting for an application to redeploy after a code fix can take an eternity. Wouldn't it be great if you could see your code changes immediately, fine-tune, debug, explore and deploy code without waiting for ages? In this white paper, find out how that's possible with a Java plugin that drastically changes the way you develop, test and run Java applications. Discover the advantages of this plugin, and the changes you can expect to see …

  • Cybercrime is getting big and bigger. 2013 was the year of the Mega Breach with eight top data breaches resulting in the loss of tens of millions of data records. Criminals are always looking for vulnerabilities to exploit. Applications are already becoming a target. Is signing code and apps the answer to protecting our users from malware in applications? Are there any challenges with code signing? In this program we answer those questions and more with two of the industry's leading experts -- Mario de …

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds