Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Missing vcx paths - Nasty Bug or did I do it myself?
Message
From
04/08/2016 15:15:36
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
04/08/2016 11:43:05
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 10
Network:
Windows Server 2012
Database:
Visual FoxPro
Application:
Desktop
Virtual environment:
VMWare
Miscellaneous
Thread ID:
01639123
Message ID:
01639138
Views:
99
>Hi all,
>
>Tried to get working this morning and could not open some classes - they were all complaining that they could not find the parent classes. That is, went to go back to work on a form I was working on last night and it would not load. So then I tried to use the class browser to look at the class and it would not load the parent.
>
>Tracked it down to the ClassLoc field missing the pathing back to the parent class e.g. parent is XXFW.vcx in d:\vmp\xlib

We actually don't know what's in classloc until there's a need to look in there. It's possible to have it screwed up if you ever move your classlib to a wrong folder and it can't find its parent class (or of any of its members), BUT: when it misbehaves like that, you can simply set path to the list of pretty much every path that appears in your pjx, something like this:
*++
*[2007/02/22 09:10:05] dragan - for oddball paths, set path to available paths in the project.
*[2007/02/23 16:00:53] dragan - no need to have the pjx open
*[2007/02/26 10:48:59] dragan - added the parameter
*[2010/03/26 20:40:37] ndragan -  IN SELECT("pjx")
*[2012/08/01 14:21:12] ndragan - use... alias, so it closes for real.
*--

LPARAMETERS tcPjx

DO CASE
	CASE _VFP.PROJECTS.COUNT>0
		oPjx=_VFP.PROJECTS[1]
		lcPjx=oPjx.NAME
	CASE PCOUNT()>0
		lcPjx=DEFAULTEXT(tcPjx, "pjx")
	OTHERWISE
		lcPjx= (GETFILE("pjx"))
ENDCASE

IF !EMPTY(lcPjx)
*[2012/05/29 13:46:39] ndragan - non-local paths go in the end
*[2013/12/09 15:00:32] nDragan - and the home folder may be foreign, ignore.
	SELECT 0
	USE (lcPjx) alias pjx AGAIN
	SELECT DISTINCT PADR(JUSTPATH(NAME),100) ;
		FROM pjx ;
		WHERE NOT "..\"$NAME	;
		and type#"H";
		INTO ARRAY aPaths
	FOR i= 1 TO ALEN(aPaths)
		DO addpath WITH aPaths[i]
	ENDFOR
	RELEASE aPaths
	SELECT DISTINCT PADR(JUSTPATH(NAME),100) ;
		FROM pjx ;
		WHERE "..\"$NAME	;
		INTO ARRAY aPaths
	IF _TALLY>0
		FOR i= 1 TO ALEN(aPaths)
			DO addpath WITH aPaths[i]
		ENDFOR
	ENDIF
ENDIF
USE IN SELECT("pjx")

PROC addpath
	LPARAM cPath
	TRY
		cPath=FULLP(ADDBS(cPath))

		IF DIRE(cPath)
			IF ATC(cPath+',', SET('path')+',')=0
				cPath=SET('path')+','+cPath
				SET PATH TO (cPath)
			ENDIF
		ENDIF
	CATCH TO oEx
		ASSERT .F. MESSAGE oEx.MESSAGE
	ENDTRY
Run this with your pjx as the parameter, and then with paths set, open your class again, do anything and save it. VFP will find the parent classlib somewhere on the path and write the (new) relative path to it into the classlib field. IOW, it will fix it for you.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform