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. C / C++ / MFC
  4. Checking an ocx is installed or not

Checking an ocx is installed or not

Scheduled Pinned Locked Moved C / C++ / MFC
question
5 Posts 3 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.
  • A Offline
    A Offline
    AnsGe
    wrote on last edited by
    #1

    Hai All, How can i check an ocx which is droped in my main application dialog is installed or not. I not used the CoCreateInstane function , but i directly placed the control in my dialog. The application crashes when the control is not installed. How can i avoid it? Thanks in Advance Ans

    B N 2 Replies Last reply
    0
    • A AnsGe

      Hai All, How can i check an ocx which is droped in my main application dialog is installed or not. I not used the CoCreateInstane function , but i directly placed the control in my dialog. The application crashes when the control is not installed. How can i avoid it? Thanks in Advance Ans

      B Offline
      B Offline
      Blake Miller
      wrote on last edited by
      #2

      You can try the CoCreateInstance before attempting to display the dialog. If that fails, do not show the dialog.

      A 1 Reply Last reply
      0
      • B Blake Miller

        You can try the CoCreateInstance before attempting to display the dialog. If that fails, do not show the dialog.

        A Offline
        A Offline
        AnsGe
        wrote on last edited by
        #3

        Hai, Actually i don't know the internal structure about the used COM component. Its a 3rd party control and i have only know some functions in it. I dont know any classid and interface id's. So how can i call CoCreateInstance() Byy Anish

        B 1 Reply Last reply
        0
        • A AnsGe

          Hai, Actually i don't know the internal structure about the used COM component. Its a 3rd party control and i have only know some functions in it. I dont know any classid and interface id's. So how can i call CoCreateInstance() Byy Anish

          B Offline
          B Offline
          Blake Miller
          wrote on last edited by
          #4

          Just trying to help here, but maybe you can use this: HRESULT CLSIDFromProgID( LPCOLESTR lpszProgID, LPCLSID pclsid ); You have to already know what the name of the OCX object is to use the function. Otherwise, you might need to manually search the registry to find where the OCX is installed, find the OCX, see what it's GUID is, and then try to use the CoCreateInstance.

          1 Reply Last reply
          0
          • A AnsGe

            Hai All, How can i check an ocx which is droped in my main application dialog is installed or not. I not used the CoCreateInstane function , but i directly placed the control in my dialog. The application crashes when the control is not installed. How can i avoid it? Thanks in Advance Ans

            N Offline
            N Offline
            naren vc
            wrote on last edited by
            #5

            hi ans, cocreateinstance is not required to instantiate the activex. i think your problem is u r not included the call to AfxEnableControlContainer(). it ll intializes the framework needed for the activeX container naren

            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