Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to capture OLE error on form load
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Contrôles ActiveX en VFP
Divers
Thread ID:
00706306
Message ID:
00706314
Vues:
21
Can not remember where I got it, but here is Cetin Basoz' code:

?iCetinBasoz("Word.Application")

*---------------------
Procedure iCetinBasoz
lparameters tcClass
#DEFINE HKEY_CLASSES_ROOT -2147483648
#DEFINE ERROR_SUCCESS 0 && OK

DECLARE Integer RegOpenKey IN Win32API ;
Integer nHKey, String @cSubKey, Integer @nResult

DECLARE Integer RegCloseKey IN Win32API ;
Integer nHKey

local lnKey
lnKey = 0
llRetVal = ( RegOpenKey(HKEY_CLASSES_ROOT, tcClass, @lnKey) = ERROR_SUCCESS )
if llRetVal
RegCloseKey(lnKey)
endif
return llRetVal

>Hi all,
>
>I need to capture for the possibility that an ActiveX control was not loaded on a workstation (i.e. they did not do a necessary update), but I can't seem to trap for the OLE error returned when the form is opening. I've tried capturing in the form.load, form.error, control.init, control.error, etc. but nothing seems to work. All I need to do is just give them a friendlier message than the "OLE error...Class not registered". What am I missing?
>
>
>Thanks,
>
>- Brian
>
>VFP6 SP5
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform