Articles   Members Online:
-Article/Tip Search
-News Group Search over 21 Million news group articles.
-Delphi/Pascal
-CBuilder/C++
-C#Builder/C#
-JBuilder/Java
-Kylix
Member Area
-Home
-Account Center
-Top 10 NEW!!
-Submit Article/Tip
-Forums Upgraded!!
-My Articles
-Edit Information
-Login/Logout
-Become a Member
-Why sign up!
-Newsletter
-Chat Online!
-Indexes NEW!!
Employment
-Build your resume
-Find a job
-Post a job
-Resume Search
Contacts
-Contacts
-Feedbacks
-Link to us
-Privacy/Disclaimer
Embarcadero
Visit Embarcadero
Embarcadero Community
JEDI
Links
Check if ActiveX is installed on a target machine Turn on/off line numbers in source code. Switch to Orginial background IDE or DSP color Comment or reply to this aritlce/tip for discussion. Bookmark this article to my favorite article(s). Print this article
06-Feb-03
Category
ActiveX
Language
Delphi 2.x
Views
193
User Rating
No Votes
# Votes
0
Replies
0
Publisher:
DSP, Administrator
Reference URL:
DKB
			Author: Jonas Bilinkevicius

How to check if ActiveX is installed on a target machine

Answer:

Solve 1:

Use the CLSIDFromProgID method:

1   { ... }
2   var
3     strOLE: string;
4   begin
5     strOLE = "YourCOMServer.Application" {your ProgID}
6     if (CLSIDFromProgID(PWideChar(WideString(strOLE), ClassID) = S_OK) then
7       begin
8         { ... }
9       end;
10  end;



Solve 2:

Check the registry:

11  { ... }
12  const
13    cKEY = '\SOFTWARE\Classes\CLSID\%s\InprocServer32'
14    var
15    sKey: string;
16    sComServer: string;
17    exists: boolean;
18    Reg: TRegistry;
19  begin
20    Reg := TRegistry.Create;
21    try
22      Reg.RootKey := HKEY_LOCAL_MACHINE;
23      sKey := format(cKEY, [GuidToString(ClassID)]);
24      if Reg.OpenKey(sKey, False) then
25      begin
26        sComServer := Reg.ReadString('');
27        if FileExists(sComServer) then
28        begin
29          { ... }
30        end;
31      end;
32    finally
33      Reg.free;
34    end;
35  end;


			
Vote: How useful do you find this Article/Tip?
Bad Excellent
1 2 3 4 5 6 7 8 9 10

 

Advertisement
Share this page
Advertisement
Download from Google

Copyright © Mendozi Enterprises LLC