Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CREATEOBJECT or NEWOBJECT 1

Status
Not open for further replies.

vhad

Programmer
May 27, 2001
26
ID
Hi All,

I'm new with Foxpro, could somebody tell me what is the different between CREATEOBJECT and NEWOBJECT ?
And when should I use CREATEOBJECT or NEWOBJECT ?

Thank you in advance.

Vincent
 
Hi!

Createobject is used by a more generic way. It could be used the same way as a NEWOBJECT with a few differences:
- Createobject, when creating VFP object from custom class, requires that the custom class library/PRG is loaded in the memory by SEL CLASSLIB/ SET PROCEDURE commands. Nowobject has a parameter that specifies the class module, so it is not required to be loaded. In addition, NewObject can specify the application (APP or EXE) that contains that class definition.
- NewObject, when called as a method of the cntainer object (for example, form.NewObject(...) ), can add a VFP object to the container.

Vlad Grynchyshyn
vgryn@softserve.lviv.ua
The professional level of programmer could be determined by level of stupidity of his/her bugs
 
Thank you very much Vlad,

It helps a lot.

I want to develop an executable (EXE) application.
And the main user interface for the application is menu, launched using 'do mymenu.mpr' from main program.

I believe this must be the Main VFP Window.
So, could I use NewObject to add an Object to main VFP window ?
Should I use _SCREEN.NewObject("classname","classlib.vcx") or _VFP.NewObject("classname","classlib.vcx") ?

Hope you understand.

Once Again Thanks.
 
Hi!

_VFP is not a container object. _SCREEN is a container (it is a form class). So use _SCREEN.
Vlad Grynchyshyn
vgryn@softserve.lviv.ua
The professional level of programmer could be determined by level of stupidity of his/her bugs
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top