Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. COM
  4. ATL COM object..

ATL COM object..

Scheduled Pinned Locked Moved COM
c++comquestion
9 Posts 4 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Siva Sankar Koyi
    wrote on last edited by
    #1

    Hi, I have the COM object "MyObj" which is inheriting from Interface "IX". This I can simply add "ATL simple object" through wizard. My qestion is I want to add one more Interface "IY" to the same object. This is posible thorugh wizard or do I need to add all the stuff manually ?? Thanks & Regards, Siva

    L 1 Reply Last reply
    0
    • S Siva Sankar Koyi

      Hi, I have the COM object "MyObj" which is inheriting from Interface "IX". This I can simply add "ATL simple object" through wizard. My qestion is I want to add one more Interface "IY" to the same object. This is posible thorugh wizard or do I need to add all the stuff manually ?? Thanks & Regards, Siva

      L Offline
      L Offline
      Laxman Auti
      wrote on last edited by
      #2

      I think you simply add the new ATLclass from New Class Wizards Knock out 'T' from CAN'T , You 'CAN' if you think you 'CAN' :cool:

      S 1 Reply Last reply
      0
      • L Laxman Auti

        I think you simply add the new ATLclass from New Class Wizards Knock out 'T' from CAN'T , You 'CAN' if you think you 'CAN' :cool:

        S Offline
        S Offline
        Siva Sankar Koyi
        wrote on last edited by
        #3

        Hi Laxman, Thanks for your reply, think you are not clear with the question, I dont want to add new class for my new Interface. I will just explain with example. My ATL class is "TestATLClassIX" which is inheriting IX and on same class I want to implemnet inter face "IY". I dont want to create a new class and derive from IY , again it goes to other ATL object. class TestATLClassIX : public IX, public IY { } This is posible through wizard ?? Thanks, Siva

        L 1 Reply Last reply
        0
        • S Siva Sankar Koyi

          Hi Laxman, Thanks for your reply, think you are not clear with the question, I dont want to add new class for my new Interface. I will just explain with example. My ATL class is "TestATLClassIX" which is inheriting IX and on same class I want to implemnet inter face "IY". I dont want to create a new class and derive from IY , again it goes to other ATL object. class TestATLClassIX : public IX, public IY { } This is posible through wizard ?? Thanks, Siva

          L Offline
          L Offline
          Laxman Auti
          wrote on last edited by
          #4

          Yes, Right click on the class select implement interface and select your typelib from the list if it is not present into the list then browse and select the path where it present that's enough. hope it is correct now.;) Knock out 'T' from CAN'T , You 'CAN' if you think you 'CAN' :cool:

          S 1 Reply Last reply
          0
          • L Laxman Auti

            Yes, Right click on the class select implement interface and select your typelib from the list if it is not present into the list then browse and select the path where it present that's enough. hope it is correct now.;) Knock out 'T' from CAN'T , You 'CAN' if you think you 'CAN' :cool:

            S Offline
            S Offline
            Siva Sankar Koyi
            wrote on last edited by
            #5

            Hi, Thanks for your info. Again if I right click and select "Implement interface" option it is asking Type Library info. I don't have any type libray stuff. But my question is very simple. Just I create a simple ATL object using wizard ( Simple object option ) let say it as "CMyATLObj" for this I gave interface "IMyATLObj". Now my component is ready. Just I want to add new Interface "IMyATLObj2" and implementaiton I want to porive in same object. Bottom line is my ATL object is going to inherit from two interfaces. is ther any way to do this by wizard or I need to edit all the files manually. Thanks, Siva

            L R 2 Replies Last reply
            0
            • S Siva Sankar Koyi

              Hi, Thanks for your info. Again if I right click and select "Implement interface" option it is asking Type Library info. I don't have any type libray stuff. But my question is very simple. Just I create a simple ATL object using wizard ( Simple object option ) let say it as "CMyATLObj" for this I gave interface "IMyATLObj". Now my component is ready. Just I want to add new Interface "IMyATLObj2" and implementaiton I want to porive in same object. Bottom line is my ATL object is going to inherit from two interfaces. is ther any way to do this by wizard or I need to edit all the files manually. Thanks, Siva

              L Offline
              L Offline
              Laxman Auti
              wrote on last edited by
              #6

              See the following Links Help me[^]

              Siva Sankar Koyi wrote:

              Just I want to add new Interface "IMyATLObj2" and implementaiton I want to porive in same object.

              Do you want to add the existing interface ??? if yes ,then for every com object .tlb file is generated that file is the Typelibrary steps to implement interface: implement interface->click typelib->select the library name/browse from file. -> ok -> select the interfaces from the list->ok done. Knock out 't' from can't, You can if you think you can :cool:

              1 Reply Last reply
              0
              • S Siva Sankar Koyi

                Hi, Thanks for your info. Again if I right click and select "Implement interface" option it is asking Type Library info. I don't have any type libray stuff. But my question is very simple. Just I create a simple ATL object using wizard ( Simple object option ) let say it as "CMyATLObj" for this I gave interface "IMyATLObj". Now my component is ready. Just I want to add new Interface "IMyATLObj2" and implementaiton I want to porive in same object. Bottom line is my ATL object is going to inherit from two interfaces. is ther any way to do this by wizard or I need to edit all the files manually. Thanks, Siva

                R Offline
                R Offline
                Renjith Ramachandran
                wrote on last edited by
                #7

                You mean You want just a class which supports two interfaces rite? Loka Samastha Sukhino Bhavanthu..!!! ( May all beings be happy and free )

                S 1 Reply Last reply
                0
                • R Renjith Ramachandran

                  You mean You want just a class which supports two interfaces rite? Loka Samastha Sukhino Bhavanthu..!!! ( May all beings be happy and free )

                  S Offline
                  S Offline
                  Siva Sankar Koyi
                  wrote on last edited by
                  #8

                  Yes..I want my component should be support two interfaces, can I do with wizard..in ATL.. Thanks, Siva

                  L 1 Reply Last reply
                  0
                  • S Siva Sankar Koyi

                    Yes..I want my component should be support two interfaces, can I do with wizard..in ATL.. Thanks, Siva

                    L Offline
                    L Offline
                    Logan from Singapore
                    wrote on last edited by
                    #9

                    Hi Siva, To do that, you can add a class like what you normally do. Thereafter is the tricky part, to remove the class and leave the interface around. To do that, in the idl file remove the code below for your second class. [ uuid(8D1E05B3-F610-4450-984E-4DCC4D2442E5), helpstring("SubClass1 Class") ] coclass SubClass1 { [default] interface ISubClass1; }; In your second class's header file, remove the 2 lines below. The second line will remove unnecessary register entry. public CComCoClass, DECLARE_REGISTRY_RESOURCEID(IDR_SUBCLASS1) In the main cpp file, remove this line OBJECT_ENTRY(CLSID_SubClass1, CSubClass1) If I do not remember wrongly that will be it, 2 interface in one COM object. I had done this in one of my DLL and it works. But if I do not remember wrongly again, you will not be able to see your second interface in VB or .Net whichever the client u are using. What I did, I had to pass the interface out. Hence I will see the interface like this in VB. dim a as FirstClass a.SecondClass.method() Hope I got your question right as I had also spend a lot of time on something like that.

                    1 Reply Last reply
                    0
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • World
                    • Users
                    • Groups