Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to capture OLE error on form load
Message
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Miscellaneous
Thread ID:
00706306
Message ID:
00706321
Views:
21
Hi Yuri,

Thanks, this is helpful for checking prior to calling the form. Unfortunately I need to check and by-pass the default error message between the Form.Load and the time the Control.init tries to fire. I.e. The form was already called.


- Brian


>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


VFP6 SP5, VFP8 SP1, VFP 9 SP 1 and Win XP SP 3 (unless otherwise specified)


www.wulfsden.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform