Reply to comment

Verify ActiveX presence and registration

An ActiveX installation on PC can be verified by finding its ProgID from OleClass property in the registry.

This is sample code. Add error handling and adjust to your requirements as necessary.

? VerifyActiveX("MSWinsock.Winsock")
? VerifyActiveX("MSCAL.Calendar")
? VerifyActiveX("MSComCtl2.DTPicker")
 
RETURN 
*-----------------------------------------
 
FUNCTION VerifyActiveX
LPARAMETERS tcProgID
#DEFINE HKEY_CLASSES_ROOT    -2147483648
 
LOCAL loReg, lcActiveXFileName, lcCLSID, llOK
loReg = NEWOBJECT("Registry", "registry.prg")
* See if ProgID for ActiveX exists in the registry
lcCLSID = loReg.ReadRegistryString(HKEY_CLASSES_ROOT, tcProgID + "\CLSID" , "")
llOK = NOT ISNULL(lcCLSID)
IF llOK
	* See if actual file implementing ActiveX is specified and exists
	lcActiveXFileName = loReg.ReadRegistryString(HKEY_CLASSES_ROOT, "CLSID\" + lcCLSID + "\InprocServer32" , "")
	llOK = NOT ISNULL(lcActiveXFileName) AND FILE(lcActiveXFileName)
ENDIF	
 
RETURN llOK

The registry class can be downloaded from http://berezniker.com/files/registry.zip

Reply

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <java>, <powershell>, <tsql>, <visualfoxpro>. The supported tag styles are: <foo>, [foo].
  • Lines and paragraphs break automatically.
  • Web page addresses and e-mail addresses turn into links automatically.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image.