Ce code inclus la vérification de la présence de l'activex Adobe Acrobat Reader avant de rouler la forme.
Code source :
local llOK
llOK=VerifyActiveX("AcroPDF.PDF.1") If llOK Public oform1
oform1=Newobject("form1")
oform1.Show Else Messagebox("Activex non présent") Endif
Local lnRegHandle, lnResult, lnSize, lcDataBuffer, tnType DeclareInteger RegOpenKey ; IN Win32API ; INTEGER nHKey,; STRING cSubKey,; INTEGER @nHandle
DeclareInteger RegCloseKey ; IN Win32API ; INTEGER nHKey
tnHKey=Iif(Type("tnHKey")="N",tnHKey,HKEY_LOCAL_MACHINE)
lnRegHandle=0
*** Open the registry key
lnResult=RegOpenKey(tnHKey,tcSubkey,@lnRegHandle) If lnResult#ERROR_SUCCESS Return .Null. Endif
*** Need to define here specifically for Return Type *** for lpdData parameter or VFP will choke. *** Here it's STRING. DeclareInteger RegQueryValueEx ; IN Win32API As RegQueryString; INTEGER nHKey,; STRING lpszValueName,; INTEGER dwReserved,; INTEGER @lpdwType,; STRING @lpbData,; INTEGER @lpcbData
*** Return buffer to receive value
lcDataBuffer=Space(MAX_INI_BUFFERSIZE)
lnSize=Len(lcDataBuffer)
lnType=0
Class not registred ( Comment faire ? )