John,
I think you have got the ticket. SET CLASSLIB is my problem. If I don't have to use it, I haven't got a problem.
I will give it a try.
>Hi Richard,
>
>How about using NEWOBJECT and avoiding SET CLASSLIB altogether in this situation, as in:
>
>oForm=NEWOBJECT("Form")
>oForm.NewObject("lblHello","MyLabelClass","MyClasslib")
>oForm.lblHello.Caption="Hello"
>oForm.lblHello.Visible=.T.
>
>>I am having a problem where I am trying to ADDOBJECT a specific class from a specific class library and it finds a class of the same name in a previously set class library.
>>
>>As users navigate through my application they are triggering SET CLASSLIB when objects need to be created in my forms. If a previously accessed form has added a class library to the SET CLASSLIB list and it contains a class definition with the same name, it is the first one in the list which is used. The result is that subsequently called forms may be adding the wrong classes.
>>
>>Should I be ensuring that my class names are unique across all class libraries that might be called?
>>
>>Should I SET CLASSLIB then ADDOBJECT then RELEASE CLASSLIB for each object being added?
>>
>>There has got to be a better way. I am sure that I must be doing something stupid.
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement