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. How can i get properties of com object dynamically

How can i get properties of com object dynamically

Scheduled Pinned Locked Moved COM
tutorialcomquestion
3 Posts 2 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.
  • I Offline
    I Offline
    Inam
    wrote on last edited by
    #1

    Actually i am developing a class in which it will take any com object and will be able to set and get the properties. Now i have taken the clsid of the component. Now how can i get its properties as GetIdsofNames function of IDispatch takes names. Please Guide me briefly with a little example or tell me some article Thanx in advance Regards minamkhan Inam

    M 1 Reply Last reply
    0
    • I Inam

      Actually i am developing a class in which it will take any com object and will be able to set and get the properties. Now i have taken the clsid of the component. Now how can i get its properties as GetIdsofNames function of IDispatch takes names. Please Guide me briefly with a little example or tell me some article Thanx in advance Regards minamkhan Inam

      M Offline
      M Offline
      Mike Dimmick
      wrote on last edited by
      #2

      GetIDsOfNames accepts property names too, but I think you want to know the names of supported properties instead. You need to read the object's type information. You can ask an object if it can provide type information by calling the GetTypeInfo method of IDispatch. You can then find out how many properties it has by calling ITypeInfo::GetTypeAttr. You can get information on the properties with ITypeInfo::GetVarDesc.

      I 1 Reply Last reply
      0
      • M Mike Dimmick

        GetIDsOfNames accepts property names too, but I think you want to know the names of supported properties instead. You need to read the object's type information. You can ask an object if it can provide type information by calling the GetTypeInfo method of IDispatch. You can then find out how many properties it has by calling ITypeInfo::GetTypeAttr. You can get information on the properties with ITypeInfo::GetVarDesc.

        I Offline
        I Offline
        Inam
        wrote on last edited by
        #3

        Sir Actually i have only the progId of the component now i want to also know how i will get the interfaces in this component dynamically than how can i get the names and return types of the properties in the interface dynamically. so that i will be able to get and set the properties in that interface. Sir please explain me little briefly as i am new to this topic. or if possible gave me a little example too. Thanx in advance Regards minamkhan Inam

        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