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 to get CLSID given ActiveX control Name

How to get CLSID given ActiveX control Name

Scheduled Pinned Locked Moved COM
comjsontutorialquestion
6 Posts 3 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.
  • A Offline
    A Offline
    Ashwin kumar Gurujala
    wrote on last edited by
    #1

    Hi, I want to know how to get CLSID of a particular activex control given its name. Is there any API to do so?

    V M 2 Replies Last reply
    0
    • A Ashwin kumar Gurujala

      Hi, I want to know how to get CLSID of a particular activex control given its name. Is there any API to do so?

      V Offline
      V Offline
      vishalmore
      wrote on last edited by
      #2

      Hi, Here is the API to get the CLSID of the activex control. CLSIDFromProgID(...) Hope this would help. Cheers, Vishal

      A 1 Reply Last reply
      0
      • V vishalmore

        Hi, Here is the API to get the CLSID of the activex control. CLSIDFromProgID(...) Hope this would help. Cheers, Vishal

        A Offline
        A Offline
        Ashwin kumar Gurujala
        wrote on last edited by
        #3

        Hi, Yes i have tried this API but not succesful. If AnalogMeter is my activeX control then i have used CLSID clsid; CLSIDFromProgID(L"AnalogMeter", &clsid); This gives error ....how to do it? how to pass activeX name as parameter to this API?

        V 1 Reply Last reply
        0
        • A Ashwin kumar Gurujala

          Hi, Yes i have tried this API but not succesful. If AnalogMeter is my activeX control then i have used CLSID clsid; CLSIDFromProgID(L"AnalogMeter", &clsid); This gives error ....how to do it? how to pass activeX name as parameter to this API?

          V Offline
          V Offline
          vishalmore
          wrote on last edited by
          #4

          The first parameter for CLSIDFromProgID has to be the PROGID Like for MS-Word, the PROGID is "Word.Application.9" You can get PROGID from HKEY_CLASSES_ROOT BTW what is the error you are getting ? You can see the error using the API GetLastError() Have fun ! Cheers, Vishal

          1 Reply Last reply
          0
          • A Ashwin kumar Gurujala

            Hi, I want to know how to get CLSID of a particular activex control given its name. Is there any API to do so?

            M Offline
            M Offline
            MohammadAmiry
            wrote on last edited by
            #5

            Hi what visahlmore was written is quite correct. but to describe more, I should note that ClassID is assigned to a class not an activex while an activex file can have one or more classes to export. Usually the class is named like "ActiveXName.ClassName" exactly the same string that you should use in CreateObject API to make an instance of the class. You can easily also find the class id in the following address in registry: HKEY_CLASSES_ROOT\ActiveXName.ClassName\CLSID

            A 1 Reply Last reply
            0
            • M MohammadAmiry

              Hi what visahlmore was written is quite correct. but to describe more, I should note that ClassID is assigned to a class not an activex while an activex file can have one or more classes to export. Usually the class is named like "ActiveXName.ClassName" exactly the same string that you should use in CreateObject API to make an instance of the class. You can easily also find the class id in the following address in registry: HKEY_CLASSES_ROOT\ActiveXName.ClassName\CLSID

              A Offline
              A Offline
              Ashwin kumar Gurujala
              wrote on last edited by
              #6

              Thanks, My problem is solved. One more thing, i need to show selected activex images in a ToolBox on start of application and allow user to drag n drop controls onto the container...Just like we do while designing a dialog box(adding buttons,etc). Any help on how to do it?

              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