Larry,
PMFJI
>You can avoid this by overwriting the SET CLASSLIB or SET PROCEDURE paths with another SET command and not specifying the ADDITIVE keyword. Or you could use the NewObject function or method. This command internally issues a new SET CLASSLIB or SET PROCEDURE command with the specified class definition first.
>
>HTH.
>
>>Hi Larry,
>>
>>I tried to see how #2 works but so far I cannot make it work. I put the following coding in a form init():
>>
>>set classlib to myclasslib
>>ocreatetxt = createobject("mytxt") && mytxt is a class in myclasslib.vcx
>>set classlib to myotherclasslib
>>this.addobject("oaddtxt", "mytxt")
>>this.oaddtxt.visible = .t.
>>
>>or
>>
>>onewtxt = newobject("mytxt", "myclasslib")
>>this.addobject("oaddtxt", "mytxt")
>>this.oaddtxt.visible = .t.
>>
>>Both codings will generate the error "Class defintion MYTXT is not found." when trying to execute the this.addobject statement.
>>
>>
>>Note: I have also added the object mytxt to the form from Form Designer. I guess this should also load the class into the memory. Am I right?
>>
>>
>>Thank you,
>>
>>Peter
Words are given to man to enable him to conceal his true feelings.
Charles Maurice de Talleyrand-Périgord
Weeks of programming can save you hours of planning.
OffThere is no place like [::1]