How can I find in Visual C++ if an OCX file (for example flash.ocx) is registered or not?
If you mean from the .ocx file itself, you've probably got two options:
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With