Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SET LIBRARY TO in subclassed textbox
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00678034
Message ID:
00678054
Vues:
17
>I'm using a sub-classed text box control to create a textbox that will save the text to the registry when its parent form unloads and retrieve the text from registry when the textbox loads later. In order to do this, I need to use the FOCUS.FLL library to gain access to the 'REG_' functions. The only problem is, SET LIBRARY TO FOCUS.FLL seems to work only within the event I coded. If I issue SET LIBRARY TO in the INIT event (to use REG_ function to retrieve text from registry) VFP returns an error when trying to use REG_ function in DESTROY event with ERROR "File reg_createvalue.prg does not exist". Does SET LIBRARY not persist across the whole life of the control? Do I have to issue SET LIBRARY for every piece of event code?

It persists until SET LIBRARY TO or SET LIBRARY TO < otherlibrary > w/o ADDITIVE clause is issued. If you're using multiple FLL's use ADDITIVE clause
SET LIBRARY TO focus ADDITIVE
SET LIBRARY TO foxtools ADDITIVE
Also, the init of the form fires after all controls on the form are created. The load would be the better place to put SET LIBRARY TO focus ADDITIVE.
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform