Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Trying to call a container class
Message
From
24/12/2000 14:24:34
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
24/12/2000 14:03:27
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00456694
Message ID:
00456696
Views:
20
>Hi...vfp6 user here
> I am trying to display a container class on a page in a pageframe.
> Would I:
> 1. Use CreateObject()
>OR 2. Use AddObject()
>
> AND
>
> Would I:
> 1. Put the code in the 'Activate' method of the page?
>OR 2. Put the code in the 'AddObject' method of the page?
>
> In any case, when I try:
> oObj = CreateObject('myclass','myclasslib'), then
>oObj.Visible = .t., I cannot see my class on the screen. It is there, because it is in the debugger.
>
>thanks, Randy

Randy,
VFP3 and up can use addobject() and VFP6 could also use NewObject().
In page.activate code like (assuming you use mycontainer as objectname and it's in c:\myclasses\myclasses.vcx):
with this
if !type('.MyContainer')='O' && Not instantiated yet
  if !'MYCLASSES.VCX'$set('classlib')
     set classlib to 'c:\myclasses\myclasses.vcx' additive
  endif
  .Addobject('MyContainer','myclasses')
  * VFP6 NewObject() could be used in place of preceding 4 lines 
  * .NewObject('MyContainer','myclasses','c:\myclasses\myclasses.vcx')
  with .MyContainer
   * set properties like left, top
    .Visible = .T. && Required
  endwith 
endif
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform