Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Instantiation of an object
Message
De
02/12/2008 06:17:23
Lutz Scheffler
Lutz Scheffler Software Ingenieurbüro
Dresden, Allemagne
 
 
À
02/12/2008 06:05:28
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:
01365047
Vues:
11
>>I have seen code whereby a reference was created to the class library, and all objects within that library were "hung off" that reference, thereby allowing you to access all objects within that library from a single reference point. To be fair, I didn't say it was a native VFP command, but then I don't generally make assumptions and would have enquired further before racing off on a wholly unrelated tangent.
>
>I bet you haven't seen a code like that. I'm quite sure, that you missunderstood something.
>It is impossible to instantiate a whole classlib with a single command, it wouldn't even make sense.
>
>I think I understand what your mistake is.
>You simply mixed up "instiating a whole classlib", with
>"instantiating a class, that provides references to other (maybe all) objects, whose classdefinitions are stored in the same classlib".
>
>So if your initial class or object provides references to other objects as members, all these other objects must have been instantiated somewhere at a certain time. I would bet somewhere during the creation process of the initial class.
>
>Calling this "instantiating a classlib" (which is nonsense) has probably guided some readers of your question into the wrong direction.
Holger

thank you for "Some Readers". LOL

The problem is that he is talking about something he has seen somewhere and put it in some UT Category.
that I do assumptions on his labyrinthian texts / Category isn't my fault.

But I'm broadminded, so I've coded a little bit around (Tea break)
*no failsafe here
loret = InstanceAllClasses(SomeVCX)
loRet.SomeClassOfTheVCXAbove.PEM

FUNCTION InstanceAllClasses
 LPARAMETERS;
  tcVCX

 LOCAL;
  loReturn  AS EMPTY,;
  lnClasses AS INTEGER,;
  lnClass   AS INTEGER

 LOCAL ARRAY;
  laClass(1,11)



 loReturn = CREATEOBJECT('EMPTY')
 lnClasses = AVCXCLASSES(laClass,tcVCX)

 FOR lnClass = 1 TO lnClasses
  IF !INLIST(laClass(lnClass,2),"oleboundcontrol","olecontrol") THEN
   ADDPROPERTY(loReturn,laClass(lnClass,1),NEWOBJECT(laClass(lnClass,1),tcVCX,0))
  ENDIF &&!INLIST(laClass(lnClass,2),"oleboundcontrol","olecontrol")
 ENDFOR &&lnClass

 RETURN loReturn
ENDFUNC &&InstanceAllClasses
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]
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform