CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 1999
    Posts
    15

    How does one detect if an ActiveX control is installed?

    I have an application which uses an ActiveX control in CMainFrame (not a dialog). I create it in the OnCreate function and then proceed to use it. If the control (MS Agent) isn't installed, it works fine (just doesn't do anything, but no errors). How can I test to see if it (the control) is installed so that I can disable menu items that use the control?


  2. #2
    Join Date
    Apr 1999
    Location
    FL
    Posts
    18

    Re: How does one detect if an ActiveX control is installed?

    1. Examine the return value from CreateControl().
    2. Look in the registry for HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID or the CLSID of the control. Then check if the file under InprocServer32 exists.
    3. Look in the registry for HKEY_CLASSES_ROOT\<prog ID> for the prog Id of the control and then look up the CLSID as in 2 above for the CLSID in in the CLSID key.

    By the way, do you know how to set read-only at run-time properties of controls that you create in the frame or view windows?

    Jay Buckman
    [email protected]


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured