Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Subclassing an ActiveX Control
Message
 
 
À
18/11/2001 16:06:15
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00583264
Message ID:
00583269
Vues:
22
It looks like VFP doesn't recognize UDF's in the expression that assigns a default value to the property. BTW, your first examle doesn't require EVALUATE().

>When subclassing an activex control, for example Microsoft ListView control in a prg file, the only syntax that worked to dynamically instantiate the appropriate control depending on the Windows version wether NT4 or W2K was the following:
>
>DEFINE CLASS myclass AS OLEControl
>OLEClass = IIF('5'$ OS(),'MSComctlLib.ListViewCtrl.2','COMCTL.ListViewCtrl.1')
>NAME='MyClass'
>.......
>ENDDEFINE
>
>If I move the evaluation to a procedure which returns the character string of the control name, for example:
>
>DEFINE CLASS myclass AS OLEControl
>OLEClass = GetName() && or EVALUATE("GetName()")
>NAME='MyClass'
>.......
>ENDDEFINE
>
>PROCEDURE GetName
>DO CASE
>CASE '5' $ OS()
>RETURN 'MSComctlLib.ListViewCtrl.2'
>CASE '4' $ OS()
>RETURN 'COMCTL.ListViewCtrl.1'
>ENDCASE
>ENDPROC
>
>the error "Invalid subscript reference" occurs when trying to instantiate an object of 'MyClass'.
>
>I'd appreciate any explanation of this behavior.
>
>Regards,
--sb--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform