+ Reply to Thread
Results 1 to 2 of 2

Creating structures/types

  1. #1
    Registered User
    Join Date
    11-26-2008
    Location
    San Francisco
    Posts
    33

    Creating structures/types

    Please forgive the naiveté as I am more accustomed to C/C++ programming than VB/VBA...

    I would like to create a structure/type for holding a variety of data, much like one would create a struct in C. I'd rather not create a Class in VB as I assume classes use more resources than would a simple structure.

    When I define a Type and then try to add it to a Collection, I get an error that user defined types must be defined in public object modules in order to be passed as Variants to late-bound functions.

    Is there a way to create a structure like this? Or should I just create a Class module? And if I create it as a class, will I need to use the New operator on each of my structures?

    Thanks for the help.
    negcx

  2. #2
    Forum Expert Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    Office 2003, 2010, 2013, 2016, 365
    Posts
    3,284
    Create a class and be done with it. What extra resources do you think they use other than the class interface? COM etc is a far bigger overhead.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1