When updating existing VFP forms with new components, you may receive OLE errors informing you that the new components are being ignored.
When you open the forms, you will see that, in fact, the components in question are missing from your form.
Not all updated components will cause this error. The error will occur when an object has been fundamentally changed (i.e. a new method or event has been added) and the component's wrapper (a map to the component's functionality that managed by VFP) has become outdated.
Other platforms such as Visual Basic are able to incorporate these changed components without difficulty. In the case of Visual Basic, component "wrapper" information (an "OCA" file) is dynamically updated by VB. VFP, on the other hand, stores component wrapper information within the form's underlying structure. Unlike VB, VFP does not dynamically update the wrapper information.
Fortunately, FoxPro's open architecture provides easy access to the code and properties of the missing objects. Characteristics of FoxPro forms are maintained in FoxPro tables with standard DBF structure … but with an SCX extension: i.e. "<FORM_NAME>.SCX"
The following procedure makes use of this open architecture to replace the code into the new objects:
"copy for recno()= 6 .or. recno() = 10 to temp" You now have preserved the notes on properties, the code for the methods and events. Each record line contains all the code and property information, in Memo fields, that you had saved with the old object(s). Browse and note especially the fields: · Objname (the name that you specified for the object) · Properties (a listing of the properties that you specified on the properties sheet for that object) · Methods (a listing of all the events and associated code for the object) |
Restore your code to the updated components: