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

  • Wednesday, September 24, 2014 8:00 AM - 9:00 AM PDT According to a recent Forrester Research report, many companies are choosing low-code platforms over traditional programming platforms, due to the speed with which low-code apps can be assembled and tested. With customer-facing applications on the rise, traditional programming platforms simply can't keep up with the "short schedules and rapid change cycles" required to develop these applications. Check out this upcoming webinar and join Clay Richardson from …

  • The explosion in mobile devices and applications has generated a great deal of interest in APIs. Today's businesses are under increased pressure to make it easy to build apps, supply tools to help developers work more quickly, and deploy operational analytics so they can track users, developers, application performance, and more. Apigee Edge provides comprehensive API delivery tools and both operational and business-level analytics in an integrated platform. It is available as on-premise software or through …

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds