Click here to Skip to main content
15,867,568 members
Articles / Desktop Programming / ATL
Article

Collection Wizard

Rate me:
Please Sign up or sign in to vote.
3.67/5 (2 votes)
6 Oct 20012 min read 82.8K   692   40   9
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


Written By
Netherlands Netherlands
VC++ and VB Programmer in the Netherlands

Comments and Discussions

 
GeneralImplementing collection of atl objects (not interface pointers) Pin
Member 54073121-Aug-03 1:18
Member 54073121-Aug-03 1:18 
QuestionHow do I init a collection inside of my VC project Pin
Andreas Schurz5-Aug-02 21:06
Andreas Schurz5-Aug-02 21:06 
GeneralProblems with Collection wizard Pin
Hass24-Apr-02 2:59
Hass24-Apr-02 2:59 
GeneralDon't work Pin
DenisK8-Oct-01 1:04
professionalDenisK8-Oct-01 1:04 
GeneralRe: Don't work Pin
frans8-Oct-01 20:49
frans8-Oct-01 20:49 
GeneralRe: Don't work Pin
16-Dec-01 20:16
suss16-Dec-01 20:16 
GeneralDoes work Pin
frans13-Jan-02 8:32
frans13-Jan-02 8:32 
GeneralRe: Don't work Pin
ameehan18-Aug-02 18:55
ameehan18-Aug-02 18:55 
GeneralRe: Don't work Pin
joe!v13-Feb-03 3:03
joe!v13-Feb-03 3:03 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.