Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I find in Visual C++ if an OCX file (for example flash.ocx) is registered or not?

Tags:

ocx

How can I find in Visual C++ if an OCX file (for example flash.ocx) is registered or not?

like image 287
hadi Avatar asked Nov 05 '22 14:11

hadi


1 Answers

If you mean from the .ocx file itself, you've probably got two options:

  1. Read the type library from the .ocx, parse out the object and interface UUIDs and see if they all exist in the registry under HKCR\CLSID, HKCR\TypeLib etc.

  2. Loop through all registered objects in the HKCR\CLSID in the registry and see if any of them reference your .ocx as their InprocServer32 reference. You may need to do path and environment variable expansion on the path you read in order to test the match.

The first method won't necessarily tell you if it's the same version of the .OCX installed, though (although you can check the path on disk for each). The second is unfortunately going to be very slow.

It's probably simplest to just re-register the .ocx I'd think.

like image 68
Rup Avatar answered Dec 09 '22 03:12

Rup