Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Instantiation of an object
Message
De
02/12/2008 03:55:38
Lutz Scheffler
Lutz Scheffler Software Ingenieurbüro
Dresden, Allemagne
 
 
À
02/12/2008 03:35:09
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01365028
Message ID:
01365031
Vues:
13
Hi Derek,

Ooops.

First you need to figure out the difference between a class, classlibrary and an object. It's not very tricky

The Object is a representation (aka instance) of a class in memory. A classlib is a container that stores class definitions

So you have instantiaded a object goMyClass of the class MyClass. createobject works fine as long set classlib is set in the right way or theclasslib could be find otherwise. Assuming you have instantiadted the object you can acces is methods, events and properties (PEM) via the object variable

This is
goMyClass.caption
is the caption of the object. If the class has a button cmd1 then
goMyClass.cmd1.caption
is the caption of cmd1

this works with any PEM

so
goMyClass.cmd1.visible = !goMyClass.cmd1.visible
will toggle the visibility of the button.

So if you like to show the form
goMyClass.show()
will do the job.

the other proble is what you mean with correct order.

You need to understand the idea of EVENTS

If you instantiate an object, a bunch of events will fire. Check help for reference.

If instantiaded you nedd to show the form (see above)

Now it depends what your form will do.

HTH

Agnes
>Hi
>
>Here's a quick question regarding class library instantiation. 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:
>
>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?
>
>Regards
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]
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform