Solved

Detecting an OCX

Posted on 1998-10-21
3
203 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

743 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now