Solved

Detecting an OCX

Posted on 1998-10-21
3
204 Views
Last Modified: 2010-04-06
How can I detect if an OCX, let's say ABC123.OCX,
is already registered, so that I don't have to register
it again ???
0
Comment
Question by:fussel
  • 2
3 Comments
 
LVL 5

Accepted Solution

by:
inter earned 100 total points
ID: 1343599
Hi,
the easiest way I know is using the fact that every OLE related object has a Unique id called CLSID in the registry. So,

1 - Determine the CLSID of the OCX you seek
  - install the OCX in your machine and open registry
  - search values for its name for example ABC123.OCX and note its root CLSID assume it is {0D84B381-8CA2-1069-AB1D-08000948F534}

2 - Determining if it is installed on any machine

function IsABCRegistered:boolean;
var
  R : TRegistry;
begin
  Result := false;
  R := TRegistry.Create;
  try
    R.RootKey := HKEY_CLASSES_ROOT;
    R.OpenKey('CLSID', false);
    Result := R.KeyExists('{BD84B381-8CA2-1069-AB1D-08000948F534}');
    R.CloseKey;
  finally
    R.Free;
  end;
end;

regards, igor
0
 

Author Comment

by:fussel
ID: 1343600
Thanks for your help !!
0
 
LVL 5

Expert Comment

by:inter
ID: 1343601
You are welcome ;-)
0

Featured Post

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question