?
Solved

Detecting an OCX

Posted on 1998-10-21
3
Medium Priority
?
208 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 5

Accepted Solution

by:
inter earned 400 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses

777 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