Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Code Adds Wrong Class
Message
 
To
12/02/2008 20:26:14
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01291993
Message ID:
01292000
Views:
15
Yes, NewObject() creates a new instance from a library or application, but it doesn't appear to work
like AddObject(). AddObject adds the class to another object, while NewObject creates an instance and
returns the reference to it.


>Doesn't the function NewObject() do something similar? It seems to have a parameter to specify the classlib.
>
>>I have a section of code that adds a button to a form. The problem is that there are
>>multiple command buttons with the same name in various class libraries all over the application.
>>
>>The name of the class and the VCX it's in are stored on the form as properties:
>>
>>
>>cLibrary = GETWORDNUM(ThisForm.button, 2, ',')
>>cClass = GETWORDNUM(ThisForm.button, 1, ',')
>>
>>SET CLASSLIB TO (cLibrary) ADDITIVE
>>
>>ThisForm.AddObject(cClass, cLibrary)
>>
>>
>>The problem is that because there are many copies of this button with the same name,
>>just in different VCS's, the wrong class is added.
>>
>>Anyone know how to fix this?
Everything makes sense in someone's mind
public class SystemCrasher :ICrashable
In addition, an integer field is not for irrational people
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform