Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Instantiation of an object
Message
From
02/12/2008 08:29:41
Lutz Scheffler
Lutz Scheffler Software Ingenieurbüro
Dresden, Germany
 
 
To
02/12/2008 07:31:16
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01365028
Message ID:
01365078
Views:
13
>"... I have never said that something is impossible with VFP. It's only impossible directly with built in commands."
>
>Yet you clearly posted in an earlier reply "You can not create a reference that hold instances of all classes of a classlibrary." - clearly this is not the case as your own subsequent code snippet clearly proves.
>
>At no point did I ever mention built-in commands, that was an assumption that you made.

If you mean third party tools, then place the tread there. If you mention CREATEOBJECT in your code and talk strange about classes and classlibs one must do assumptions.

And I repeat You can not create a reference that hold instances of all classes of a classlibrary
Read the code.
-It can not deal with all baseclasses
-It uses the NOINIT parameter of NEWOBJECT(). This something different then CREATEOBJECT

But, you insist that I'm assuming So lets analyze your first message

> Here's a quick question regarding class library instantiation.

You can not instantiate ClassLibs. You might USE them, but this seems not to be what you want.

> I have a class library called MyClass.vcx, which has several objects within it (including forms) - I use the command goMyClass = createobject('MyClass') to > instantiate the object, but the question is this:

This line implies that you have a class 'MyClass' in some classlib (I'm kind and assume you have used SET CLASSLIB TO MyClass.vcx without mention)
I myself call it rubbish to name a class the same as the vcx. But I'm not sniffy, this is your code.

> When using the reference to show forms within the class library, which is the correct method to fire so that the form runs as though it were being run in
standalone, i.e. all the methods are run in the correct order. As an example, I use =goMyClass.myForm.Show(), but is this the correct method to use?


To my poor english, those lines are complete nonsense. I will do a print of them and put into a frame. You mix up class lib, running a form in "correct order", inventing "goMyClass.myForm" (what implies that MyClass is a formset or the init of MyClass creates some property myForm. Remember, your code instantiates an object of class 'MyClass' of your vcx "MyClass.vcx" This is as is was written, not whatever you have meant)

What do you think could one do with this mix up of instantiations, classlibs and forms? What the hell is "methods are run in the correct order"? There are no methods that run in any order to instantiate an object. There are events

What do you think is "correct method to fire"? Method of what? Built in? Third party? Everbody on his true mind would assume that you are talking about internal VFP.

BTW, my code is a function. CREATEOBJECT(), NEWOBJECT() are functions.

So my initial answer was to somebody that surely mixed all one can do with classes and classlibs (lucky I was that you don't mention encapsulation and inheritence)
I might have a poor understanding of english. But I understand VFP, I understand the correct terms. And I know what can be instantiated and what not. So stop blaming me for your message.


Agnes
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.

Off

There is no place like [::1]
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform