Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Error With VCX in ClassLib Stack ???
Message
De
24/05/2004 17:21:57
Dragan Nedeljkovich
Now officially retired
Zrenjanin, Serbia
 
 
À
24/05/2004 16:36:24
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00906698
Message ID:
00906716
Vues:
17
>Hi,
>
>I have the following code that adds some containers "on the fly". This works in dev mode and the class library containing the classes is in the ClassLib stack :-
>
>
>m.cPageExpr = 'THIS.Page' + TRANSFORM(THIS.ACTIVEPAGE)

This can be simplified into
oPage=this.pages[this.activepage]

>IF NOT PEMSTATUS(EVALUATE(m.cPageExpr), 'oCntethniccountsview04', 5)
>	EVALUATE(m.cPageExpr + [.ADDOBJECT('oCntethniccountsview04', 'cntethniccountsview04')])
>	m.oContainer = EVALUATE(m.cPageExpr + '.oCntethniccountsview04')
>	m.oContainer.TOP 	= 263
>	m.oContainer.LEFT	= 250
>ENDIF
>IF NOT PEMSTATUS(EVALUATE(m.cPageExpr), 'oCntethniccountsview05', 5)
>	EVALUATE(m.cPageExpr + [.ADDOBJECT('oCntethniccountsview05', 'cntethniccountsview05')])
>	m.oContainer = EVALUATE(m.cPageExpr + '.oCntethniccountsview05')
>	m.oContainer.TOP 	= 263
>	m.oContainer.LEFT	= 234
>ENDIF
>THISFORM.oStateManager.BroadCast('REG YEAR')
>
>
>However, on site, we are getting a somewhat annoying "Locate Class" dialog that says ... "Error instantiating class. Cannot find "c:\vgs\source\hecontainers.vcx".

>FYI, hecontainers.vcx is built in to the .EXE file.

>VFP must have found the hecontainers.vcx library in the classlib stack because it has at the very least identified which VCX the container classes belong to or can be found in with no clue from the developer code ie., ADDOBJECT() does not have a "cModule" type property in which to specify the containing library file. The VCX (and many others in question) are built in to the distributed EXE and are in the SET CLASSLIB TO stack.

Can you just add a set("classlib") to your error log? Just to make sure the classlib is really included there.
Also, you may try with .NewObject() instead of .AddObject(), since the former is independent from set("classlib").

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform