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.
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only