Thread: ATL Control Full Object Model

  1. #1
    Registered User
    Join Date
    May 2004
    Posts
    4

    Question ATL Control Full Object Model

    Hello everybody!

    First let me introduce myself, I am expert at VB and learning C++(ATL Controls).

    I have one BIG question and I hope you will help me

    I would like to know how to implement full object model into my ATL control like in following diagram:

    Code:
    -----------------
    MyControl(Bars)
     Bars(Add, Item, Remove)
       Bar(Text, Key)
    -----------------
    I wold be grateful if anyone could provide me with the sample of this code or point me to some helpfull articles on internet.

    Thank you,
    7thSeeker

  2. #2
    vae victus! skorman00's Avatar
    Join Date
    Nov 2003
    Posts
    594
    Look around the MFC. Heres a link that may help:

    http://msdn.microsoft.com/library/de...html/mfchm.asp

  3. #3
    Registered User
    Join Date
    May 2004
    Posts
    4
    Thanks, but I want to do it without MFC.

  4. #4
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,793
    What your asking doesnt make a whole lot of sense to me, but it looks like you are asking about Enumerators (Objects that allow you to iterate over elements usinf a For...Next in VB).

    If so Have a search on the various IEnumXXXX interfaces.

    When you have an idea on thier implementation, take a look at some of the ATL wrapper classes used to create Enumeration Objects (ComEnumOnSTL is a class that I have used in the past).

    Also, if your going into the dark world of ATL, a decent book wood make life a lot easier.

  5. #5
    Registered User
    Join Date
    May 2004
    Posts
    4
    I would like to have ATL control with Bars function in it so that when user calls Bars function it will provide reference to Bars class. Now in Bars class there will be several functions like Add, Item, remove.
    Add function will create a new class called Bar and save it in internal collection object in Bars class.
    Item function will return, based on specified key Bar class.

    The code for it in VB would be something like this:

    ' add bar object
    AtlControl.Bars.Add "BarKey", "BarCaption"
    ' return bar object
    AtlControl.Bars.Item("BarKey").Caption = "NewBarCaption"
    ' remove bar object
    AtlControl.Bars.Remove "BarKey"


    I hope this makes sense.

    Thank you,
    7thSeeker

  6. #6
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,793
    Quote Originally Posted by 7thSeeker
    I would like to have ATL control with Bars function in it so that when user calls Bars function it will provide reference to Bars class. Now in Bars class there will be several functions like Add, Item, remove.
    Add function will create a new class called Bar and save it in internal collection object in Bars class.
    Item function will return, based on specified key Bar class.

    The code for it in VB would be something like this:

    ' add bar object
    AtlControl.Bars.Add "BarKey", "BarCaption"
    ' return bar object
    AtlControl.Bars.Item("BarKey").Caption = "NewBarCaption"
    ' remove bar object
    AtlControl.Bars.Remove "BarKey"


    I hope this makes sense.

    Thank you,
    7thSeeker
    Yeah...that's pretty much the IEnumXXXX interface - it's common across COM.

    Look it up in MSDN

  7. #7
    Registered User
    Join Date
    May 2004
    Posts
    4
    Thanks!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. brace-enclosed error
    By jdc18 in forum C++ Programming
    Replies: 53
    Last Post: 05-03-2007, 05:49 PM
  2. Button handler
    By Nephiroth in forum Windows Programming
    Replies: 8
    Last Post: 03-12-2006, 06:23 AM
  3. Model View Control (MVC)
    By Mikro in forum C++ Programming
    Replies: 2
    Last Post: 11-18-2005, 01:09 PM
  4. very weird .h problem
    By royuco77 in forum C++ Programming
    Replies: 1
    Last Post: 09-11-2005, 07:55 AM
  5. ATL: fireing events from a Instanced object
    By CHECCO in forum C++ Programming
    Replies: 2
    Last Post: 09-03-2002, 07:05 AM