Cy
Sat Mar 31 19:25:01 CDT 2007
You can get the same result by using the name verb of DO FORM using the
variable as the name. You can also release the form using
"oProgress.release()" rather than trying to get rid of the form by
removing the reference. I would still release the reference variable,
but it's best form to actually tell the form to release first.
Additionally using the name verb makes it simpler to pass parameters to
the form. (you can of course do it either way, but it looks simpler to
me with the do form)
Cy Welch
Senior Programmer
MetSYS Inc
http://www.metsysinc.com
Jim Czeb wrote:
> No, the new form object is created from a prg and is not saved. It
> is instantiated and released when I am done with it.
> I never use path statements. All objects are in the same folder. All
> pathing to data is done directly via variables loaded from a
> database. The internal pseudo pathing that Foxpro uses inside
> projects finds the other 80 graphics used by the forms fine but that
> is because the forms and references to them exist when the project is
> created. I tried changing the pathing in the code that creates the
> form (seen below) but it still does not work. Using relative path or
> absolute path does not work. I have not tried creating a bogus form
> that never gets used with that graphic on it to see if that works.
> Note: I need to use the createobject to instantiate the form because I
> want to be able to create a modless form that I can release from a
> prg. Code is below:
>
> oProgress = createobject('progressform')
> oProgress.Show
> ......
> do other stuff
> release oProgress
> do more stuff
>
> * ============================
> procedure CreateProgressForm
> * ============================
> *-- ParentClass: form
> *-- BaseClass: form
> *
> define class progressform as form
>
> Height = 140
> Width = 550
> DoCreate = .T.
> AutoCenter = .T.
> BorderStyle = 0
> TitleBar = 0
> WindowType = 0
> AlwaysOnTop = .t.
> BackColor = RGB(255,255,255)
> Name = "ProgressForm"
>
> add object lblMessage as label with ;
> AutoSize = .T., ;
> FontBold = .T., ;
> FontItalic = .T., ;
> FontSize = 20, ;
> Caption = "Please wait while data is processed.", ;
> Left = 48, ;
> Top = 105, ;
> Backstyle = 0, ;
> ForeColor = RGB(128,0,128), ;
> Name = "lblMessage"
>
> ADD OBJECT image1 AS image WITH ;
> Picture = "rotating_message.gif", ; ####### this graphic is not
> found
> Height = 92, ;
> Stretch = 1, ;
> Left = 180, ;
> Top = 12, ;
> Width = 169, ;
> visible = .t., ;
> Name = "Image2"
>
> enddefine
>
>
> czeb
>