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. IUnknown Vs IDispatch???

IUnknown Vs IDispatch???

Scheduled Pinned Locked Moved COM
visual-studiotestingtoolsquestion
9 Posts 5 Posters 0 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.
  • H Offline
    H Offline
    Hariharan T
    wrote on last edited by
    #1

    Is Automation the only major concern between IDispatch and IUnknown??? or anything else hiding in??:^) Hariharan.T

    L 1 Reply Last reply
    0
    • H Hariharan T

      Is Automation the only major concern between IDispatch and IUnknown??? or anything else hiding in??:^) Hariharan.T

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      One small thing to know - IUnknown is a base interface from which every interface should either directly or indirectly derive. Even IDispatch is derived from IUnknown. Best thing according to me would be trying find/understand why IUnknown is really required and same abt IDispatch. This will help you understand them better.* * *

      Have a great day ahead! Regards, Sohail Kadiwala (My Blog - http://blogs.wdevs.com/sohail/[^])

      T 1 Reply Last reply
      0
      • L Lost User

        One small thing to know - IUnknown is a base interface from which every interface should either directly or indirectly derive. Even IDispatch is derived from IUnknown. Best thing according to me would be trying find/understand why IUnknown is really required and same abt IDispatch. This will help you understand them better.* * *

        Have a great day ahead! Regards, Sohail Kadiwala (My Blog - http://blogs.wdevs.com/sohail/[^])

        T Offline
        T Offline
        ThatsAlok
        wrote on last edited by
        #3

        Hi Sohail Sir!, i Would also like to knwo in what case IUnKnown is better and in what case IDispatch is better. Thanks


        "I Think this Will Help"

        visit me at http://www.thisisalok.tk
        G M 2 Replies Last reply
        0
        • T ThatsAlok

          Hi Sohail Sir!, i Would also like to knwo in what case IUnKnown is better and in what case IDispatch is better. Thanks


          "I Think this Will Help"

          visit me at http://www.thisisalok.tk
          G Offline
          G Offline
          geo_m
          wrote on last edited by
          #4

          Hi! IDispatch was designed for usage from script languages. If you look into details, how does it work, you'll find that intent easily. So answer to your question in COM borders is quite impossible - IUnknown cannot be better than IDispatch, because when you use the IDispatch, you use the IUnknown as well. But it's worth of use if you talk to script languages (VB counts here as script language) The core parts of the IDispatch are GetIdsOfNames and Invoke. The whole IDL part is just an add-on to the automation part, I can describe that if you want (this post is quite long anyway)

          T 1 Reply Last reply
          0
          • G geo_m

            Hi! IDispatch was designed for usage from script languages. If you look into details, how does it work, you'll find that intent easily. So answer to your question in COM borders is quite impossible - IUnknown cannot be better than IDispatch, because when you use the IDispatch, you use the IUnknown as well. But it's worth of use if you talk to script languages (VB counts here as script language) The core parts of the IDispatch are GetIdsOfNames and Invoke. The whole IDL part is just an add-on to the automation part, I can describe that if you want (this post is quite long anyway)

            T Offline
            T Offline
            ThatsAlok
            wrote on last edited by
            #5

            Hello Sir! I think, I got something in my mind from your above Post.if any problem come in my way,I think I am going to agian knock your Door. Thanks.


            "I Think this Will Help"

            visit me at http://www.thisisalok.tk
            G 1 Reply Last reply
            0
            • T ThatsAlok

              Hello Sir! I think, I got something in my mind from your above Post.if any problem come in my way,I think I am going to agian knock your Door. Thanks.


              "I Think this Will Help"

              visit me at http://www.thisisalok.tk
              G Offline
              G Offline
              geo_m
              wrote on last edited by
              #6

              No problem ;)

              L 1 Reply Last reply
              0
              • G geo_m

                No problem ;)

                L Offline
                L Offline
                Lost User
                wrote on last edited by
                #7

                I think I dont need to comment more on this :)

                T 1 Reply Last reply
                0
                • L Lost User

                  I think I dont need to comment more on this :)

                  T Offline
                  T Offline
                  ThatsAlok
                  wrote on last edited by
                  #8

                  Thanks Dear you are Back to Help me out:)


                  "I Think this Will Help"

                  visit me at http://www.thisisalok.tk
                  1 Reply Last reply
                  0
                  • T ThatsAlok

                    Hi Sohail Sir!, i Would also like to knwo in what case IUnKnown is better and in what case IDispatch is better. Thanks


                    "I Think this Will Help"

                    visit me at http://www.thisisalok.tk
                    M Offline
                    M Offline
                    Mayur Mahajan
                    wrote on last edited by
                    #9

                    ThatsAlok wrote: in what case IUnKnown is better and in what case IDispatch is better. The magic of IDispatch is apparent in automation clients. If you have a server implementing multiple interfaces along with support for automation, an obvious method would be to have a default IDispatch derived automation interface. The smart or VTABLE aware clients can well use the IUnknown derived interfeces. So the entire interface design scenario will be governed by the requirements of your server ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

                    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