Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

Collection Wizard

0.00/5 (No votes)
6 Oct 2001 1  
This program was written to make implementing a collection in ATL a snap

Sample Image - CollectionWizard.gif

Introduction

This program was written to make implementing a collection in ATL a snap. The first time I built a collection class in ATL it took me several hours. Than I found a very useful class written by Chris Brooks that allowed me to do it in 20 minutes. All this class needed was an easy way to generate the right parameters which is what this program does. Now you can generate a working collection class in half a minute.

This program also makes use of a .ocx that I wrote around a class by Michael Hofer (CDirTreeCtrl). In order for it to work you need to click on Install.bat in this folder (in LookHereFirst/).

How to make a collection class the easy way

  1. create an ATL dll project.
  2. add 2 classes (e.g Data and DataGroup)
  3. compile the project.

Now run CollectionWizard. First browse to your project's folder. Then click step 1. This will read the *_i.c file in your project and fill up the combo's. It will also read Collectionhelper.h included at the end of the .exe into your project's folder.

Make sure the right items are selected in the combo's and that the collection classname is spelled correctly.

Then hit step 2. All you need to do now is copy and paste the results in your .idl file and the collection class headerfile ('DataGroup.h').

Your collection is now fully implemented so you can concentrate on your 'Data' class instead!

The release version in LookHereFirst/ works "as is" but if for some reason you need to rebuild it it's a little trickier.

You will need to zip "collectionhelper.h" to the end of your .exe.

How to add collectionhelper.h to the end of your executable

Make  a directory /cpp at the root of your drive and place Collectionhelper.h there.

Then, build the project, run the release version and here,while holding down Ctrl+Shift click the lower copy button. This will create a folder temp2847 in your release folder with in it your new .exe that will take the place of the exe you just ran. (Simply cut and paste it to where you need it).

This version will have the file appended to the end which is what is needed for this program to work.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here