Re: VFP Objects for a beginner - help!
- From: "Cindy Winegarden" <cindy_winegarden@xxxxxxx>
- Date: Thu, 4 May 2006 15:35:17 -0400
Just to add, you would create a project that had the class library(s)
(either PRG or VCX) in it and compile it as a DLL rather than an EXE. The VB
guy would set a reference to the DLL in his project and then could
instantiate the class, set it's properties as appropriate, and call its
methods as appropriate. Note that code compiled as a DLL can not have _any_
user interface. Think of it as something that is "invisible" so the user
can't see it to click a button or whatever. However, as Dan's example shows,
you can write to a log file which is a useful way to debug and also pass
information to an operator.
Also, think of the object's properties as variables and the methods as
functions or procedures. The "OOP" way to pass in variables is to set the
object's properties. The Custom class is designed for use as a base class
for things like this; however, developers often use Session or Line because
they use less resources.
oTalk = CreateObject("Talk")
oTalk.SayWhat = "Hello world"
oTalk.Talk()
Define Class Talk As Custom
SayWhat = ""
Procedure Talk
MessageBox(This.SayWhat)
EndProc
EndDefine
--
Cindy Winegarden MCSD, Microsoft Visual FoxPro MVP
cindy_winegarden@xxxxxxx www.cindywinegarden.com
"Dan Freeman" <spam@xxxxxxxxxxxxx> wrote in message
news:eEn4b56bGHA.4108@xxxxxxxxxxxxxxxxxxxxxxx
These are deceptively HUGE and complex questions. LOL
An "object" (which really only exists at runtime) is nothing but a blob
that
contains some data and some code. It may or may not do something useful.
Using your "Hello World" as an example, you'd start with a class
definition
that might look like this:...
.... I want to begin porting
some of these paramterized functions in to objects that I can use
from within this app but also distribute so that another guy who is a
VB .net programmer can drop in his app. ....
.
- Follow-Ups:
- Re: VFP Objects for a beginner - help!
- From: JWB
- Re: VFP Objects for a beginner - help!
- References:
- VFP Objects for a beginner - help!
- From: JWB
- Re: VFP Objects for a beginner - help!
- From: Dan Freeman
- VFP Objects for a beginner - help!
- Prev by Date: Re: VFP Objects for a beginner - help!
- Next by Date: Re: VFP Objects for a beginner - help!
- Previous by thread: Re: VFP Objects for a beginner - help!
- Next by thread: Re: VFP Objects for a beginner - help!
- Index(es):