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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Wrong Path To Class Issue...

Status
Not open for further replies.

xBaseDude

MIS
Jan 31, 2002
357
US
Wrong Path To Class Issue...

So in this 60 project that I am now running under 70, I am attempting to run a progress bar for a query on a form.

The progress bar uses the _them.vcx class, located under ..\visual foxpro 7\ffc

For some reason or another, I can not figure out how to set the proper path to the vcx.

I'm getting an err msg coz fox is looking in the wrong directory. It keeps looking in "..\program files\microsoft visual foxpro 7\" dir

I have removed the class from the project, added it again to the project (By using the windows Getfile dialog - so I *know* I'm in the right directory), rebuilt the project and form, and still erred as foxpro went looking in the ..7\ root for the vcx.

Ack!!!

So I go to menubar "Tools -> Options -> Controls Tab" and add the _therm.vcx there, and SET AS DEFAULT.

Rebuild project/form etc...etc...err again with path issue.

So I copy down _therm.* to the current program dir...

Rebuild project/form etc...etc...err again with path issue.

Me brethren, I give up! How the heck do I get fox to see the vcx in the ffc dir?

TIA - Wayne

sig_jugler.gif
...all this and tap dancing too!
 
My guess is that the pathe to the class is stored in the form (scx) file still and it can't find the path it's pointing to.

Make a copy of the scx and sct files for your form

Open the scx file with something like (assuming your form file is called MyForm.scx and is stores in c:\forms)

close all
use c:\forms\myform.scx alias MyForm
browse for '_them.vcx' $ lower classloc

look in the classloc memo field and check the path. Update it to point to the ..\visual foxpro 7\ffc folder (remembering that you ma need an absolute path rather than a relative one, depending on the locations of your form and our VFP7 install).

close the form file

USE

try modifying the form now

MODIFY FORM MyForm

HTH

Cheers,

Andrew

Andrew Coates
OzFox 2003 Australia's VFP Conference --
 
Andrew;

Thanx for takin' the time to reply.

Your suggestion was a great idea.

Checked the .scx for the reference.

Regretably, none of the classloc fields contained the reference to the _therm.vcx class path.

Anyone else have a sugggestion?

Regards - Wayne



sig_jugler.gif
...all this and tap dancing too!
 
Wayne,

Were you able to locate the specific record for the progress bar while "using" the form as a table as Andrew suggested? (Search the objname field for the name of the progress bar object on your form, or the class field for progress bar's class.) What is in the classloc field for that record?

Teresa
 
A couple of different thoughts here...

In TOOLS - OPTIONS - File Locations tab you will see a bunch of system path variables and such, add the path to your FFC folder to the Search Path(NOTE: paths are separated by semi-colons). As for when you run the program the vcx just needs to be included in the EXE and then use something like

SET CLASSLIB TO _therm.vcx in myapp.exe Additive

...lastly I would say that if you need another way when in run mode but using the actual vcx from it's location under the VFP install directory to find the _therm.vcx you could use something like:

HOME()+"FFC\_therm.vcx"

One more thing before I go...if you have added the _therm.vcx to the project but are having a problem getting it to compile because of the error then I would open the PJX file up as a table and look for the path in there using something like

***Before running use the PJX file like you would a table
***USE MyApp.pjx IN 0
Local n_len, strfield, blnstop
=Afields(aryfields)
n_len = Alen(aryfields)
blnstop = .F.
For i = 1 To n_len Step 16
strfield = aryfields(i)
Go Top
Scan All For "_therm" $ lower(Transform(&strfield))
If Messagebox("Found match at Record Number " + Transform(Recno())+" in Field "+ aryfields(i), 36, "STOP SEARCHING?") = 6
blnstop = .T.
Exit
Endif
Endscan
If blnstop
Exit
Endif
Endfor

Messagebox("FINISHED SEARCHING")


...this wil at least let you know where the info is (or isn't) without your having to go look manually through all those fields.

Slighthaze = NULL
 
Wayne:
What is your code to create the Progress Bar object?
This may give someone a hint.




Andy Rice
San Diego, CA
 
Here's what I found that worked for me.

Adding the _therm.vcx did not seem to follow any of the conventions mentioned in the help file. Adding the correct dir/file under proj classes in the 70 proj did not seem to register the file location of the vcx to the form.

Likewise adding the vcx by "droppping" it onto the form did not work for me.

Finally from the main menu bar go...

Tools -> Options and click on the "File Locations" tab.

Look under the "File Type" column and go down to the "Default Directory".

Browse over to the location of the _therm.vcx and set that directory as the "Default Directory".

In my instance it was c:\program files\microsoft visual foxpro 7\ffc

Once "Set as Default" the program found the file, and ran as I expected.

Live and Learn...

Thanx to all who stopped to help!

Regards - Wayne


Andy...the calling code was called from a method as such...

LOCAL lotherm, lctask, lnpercent, lnseconds
txttitle=[Patience Please....]
lotherm = NEWOBJECT("_thermometer","_therm","",txttitle)
lctask = [Processing Files]


* err was on the lotherm line


sig_jugler.gif
...all this and tap dancing too!
 
It's good you have it working.
I'm just curious. If you specify the .exe, or .app as the third parameter, will it create the class?

From the Help:
"cInApplication
Specifies the Visual FoxPro application (.exe, or .app) containing the .vcx visual class library you specify with cClassLibName. You must include an extension for the application. CInApplication is ignored if cModule is omitted, or if cInApplication is the empty string or the null value."


Andy Rice
San Diego, CA
 
Andy,

You should not have to set your default path to the directory the VCX resides in, that would make it impossible to have VCX class libraries in your project that are in different directories (and almost all of my projects have class libraries from all over my PC). I still feel that the solutions I proposed above or the one that you have now proposed would solve this problem...I usually forego the third parameter in favor of setting the Classlib since I usually have multiple classes in my VCX, but your solution may be more appropriate for this given that there is a single class created.

Slighthaze = NULL
 
Slighthaze:
That's not your real name, is it? <g>.
It sounds like you usually SET CLASSLIB.
I never use that, just my preference.

I put the name of the VCX, but not the full path to it, in the second parameter.
FoxPro can usually find that classlib in the project.
I sometimes needed to also put the name of the APP/EXE in the third parameter.



Andy Rice
San Diego, CA
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top