Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Two classes with the same name of form
Message
De
09/05/2000 23:09:08
 
 
À
09/05/2000 21:33:50
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00367864
Message ID:
00367952
Vues:
22
Erik,

>Well, I'll be damned. It looks like it works (if the classlib is in SET CLASSLIB, otherwise, you get "Class definition is not found"). I stand corrected.

WhoWouldAThunkIt?

This is in the Help for CREATEOBJECT(), but it's buried in the description of OLE object instantiation, kinda like an aside (BTW, you can do this with regular classlibs):

A class library can have an alias. To specify an object in a class library with an alias, include the class library alias followed by a period and the object name.

And in the help for SET CLASSLIB:

ALIAS AliasName

Specifies an alias for the visual class library. The visual class library can be referenced by its alias. For example, the following commands open a .vcx visual class library named MyClass, assign it the alias MyCntrls, and then create a control named MyButton.

SET CLASSLIB TO MyClass ALIAS MyCntrls
mMyButton = CREATEOBJ('MyCntrls.MyButton')




>
>How did you find this? It is not documented anywhere that I can find.
>
>
>>Try it out, it works for me.
>>>>loForm1 = CREATEOBJECT("Lib1.cSomeForm")
>>>>loForm2 = CREATEOBJECT("Lib2.cSomeForm")
>>>
>>>This won't work. The file.classname syntax is for COM objects, not VFP classes.
David Stevenson, MCSD, 2-time VFP MVP / St. Petersburg, FL USA / david@topstrategies.com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform