Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
_vfp and Application Container Objects
Message
 
 
To
01/11/2004 12:32:54
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
00956625
Message ID:
00956677
Views:
7
Gary,

>I am new to using application objects in VFP & I am looking at the _vfp object and would like to know how it was created and on what base Base class object is it based on?

_vfp is an internal object that just is. It'll be there in the development as well as the runtime. It's mostly there to have access to system sort of information, and you can't subclass it.

You can extend it with your own custom properties via:

addproperty( _vfp, "myprop", 7 )
? _vfp.myprop

but that has limited functionality because you can't add code.

_screen supports an AddObject() method so that you can add your own custom objects into it.

>Secondly I want to build my own Application object(partly so that I understand everything in it, partly as a learning exercise) rather than use an existing one (such as the wizards create) and I am looking for some examples of building simple but functional application objects programmatically from a Base class.

Most developers use their own "scheme" for this, some use third-party frameworks.

It is as simple as this:
goApp = createobject( "MyApp" )
? goApp.MyMethod()

define class MyApp as custom
myprop = 1
function MyMethod()
return "Hi Gary"
endfunc
enddefine
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Previous
Reply
Map
View

Click here to load this message in the networking platform