I have a vfp system where the source is in two folders.
Dev folder for forms, prgs, frx, etc. Plus a sub folder containing
all graphics, bmp, jpg, gif, ico, etc.
The graphics are mainly used on forms and buttons on forms.

I have added a createobject routine that creates a form from a prg.
this form contains a graphic that is not used anywhere else. I
manually added the graphic file to the project in the other files
section. It is not marked as excluded
When I build the project no errors are encountered but when I run the
exe from the production location the graphic cannot be found.

I tried placing a reference to the graphic into the main program
within an if statement that is never true but this didn't help either.

If I copy the graphic to the production folder to the same relative
folder location as development it is found.
Why isn't this found.

Anyone with experience in getting this to work correctly???

Czeb

Re: VFP 9 project question by swdev2

swdev2
Thu Mar 29 21:36:55 CDT 2007

whats the contents of your 'set path' statement inside the main program?

also - are you saving the form thats generated from the createobject() call
as a form?
if so, you'll want to hack the scx to remove absoluting pathing.

Regards [Bill]

--
===================
William Sanders / EFG VFP / mySql / MS-SQL
www.efgroup.net/vfpwebhosting
www.terrafox.net www.viasqlserver.net

"Jim Czeb" <james.czebiniak@pearlcarroll.com> wrote in message
news:1175194906.993439.58510@p15g2000hsd.googlegroups.com...
> I have a vfp system where the source is in two folders.
> Dev folder for forms, prgs, frx, etc. Plus a sub folder containing
> all graphics, bmp, jpg, gif, ico, etc.
> The graphics are mainly used on forms and buttons on forms.
>
> I have added a createobject routine that creates a form from a prg.
> this form contains a graphic that is not used anywhere else. I
> manually added the graphic file to the project in the other files
> section. It is not marked as excluded
> When I build the project no errors are encountered but when I run the
> exe from the production location the graphic cannot be found.
>
> I tried placing a reference to the graphic into the main program
> within an if statement that is never true but this didn't help either.
>
> If I copy the graphic to the production folder to the same relative
> folder location as development it is found.
> Why isn't this found.
>
> Anyone with experience in getting this to work correctly???
>
> Czeb
>



Re: VFP 9 project question by Jim

Jim
Fri Mar 30 06:39:25 CDT 2007

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


Re: VFP 9 project question by Cy

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
>