Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Bug in DEFINE CLASS x AS y OF ClassLib.PRG
Message
From
05/12/2001 15:23:05
Charlie Schreiner
Myers and Stauffer Consulting
Topeka, Kansas, United States
 
 
To
05/12/2001 11:17:37
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00589361
Message ID:
00590122
Views:
34
Hi Jim,
Thanks for your demo. I should undoubtably be using the TEXT TO command more! Your code helped me realize that Mark wasn't right after all. :-)
If I build an EXE and put no extenstion, the classlib is not found and the exe fails to run. If I use the FXP extension, the EXE runs fine. However, if I erase my FXPs in developement mode (as I do because I never want stale FXPs around with VSS and SOS), my DO FORM xyz fails because certain ClassLibs aren't automatically compiled. So the solution is to ensure my developement mode not only erases the FXPs, but recompiles the PRGs so I always have good FXPs around. Also, one must use the FXP or VCX extension in the OF clause.

>>DEFINE CLASS deSD AS deIDSD OF deSD.PRG
>>I changed the syntax to DEFINE CLASS deSD AS deIDSD OF deSD.FXP and that worked.
>
>I think this is at the very least a documentation error, if not a product bug, and I passed it up the line for you. Here is some test code you can use to test with PRG and VCX classes. I need the FXP extension for the PRG class to be recognized in the EXE, and the VCX extension for the visual class library to be recognized.
>
>
>CLEAR
>DELETE FILE testxx.pjx
>CREATE PROJECT testxx nowa
>TEXT TO lcText NOSHOW
>ox = CREATEOBJECT('form2')
>ox.show(1)
>* change to OF testxxB.vcx to test with VCX.
>DEFINE CLASS form2 AS form1 OF testxxA.fxp
>ENDDEFINE
>ENDTEXT
>DELETE FILE testxx.prg
>=STRTOFILE(lcText,'testxx.prg',0)
>
>TEXT TO lcText NOSHOW
>DEFINE CLASS form1 AS form
>autocenter = .t.
>Caption = this.classlibrary
>ENDDEFINE
>ENDTEXT
>DELETE FILE testxxA.prg
>=STRTOFILE(lcText,'testxxA.prg',0)
>
>DELETE FILE testxxB.vc?
>CREATE CLASS form1 OF testxxB.vcx as form NOWAIT
>ASELOBJ(xx,1)
>xx[1].autocenter = .t.
>xx[1].writemethod('init','this.caption = this.classlibrary')
>ACTIVATE WINDOW 'class designer'
>KEYBOARD '{ctrl+w}'
>
>_vfp.ActiveProject.files.add('testxx.prg')
>_vfp.ActiveProject.files.add('testxxA.prg')
>_vfp.ActiveProject.files.add('testxxB.vcx')
>IF !_vfp.ActiveProject.Build('testxx.exe')
>	?"build failed"
>	_vfp.ActiveProject.close
>	RETURN
>ENDIF
>_vfp.ActiveProject.close
>DELETE FILE testxxA.prg
>DELETE FILE testxxA.fxp
>DELETE FILE testxxB.vc?
>lcRuncmd ="! /n "+SET("Default")+CURDIR()+'testxx.exe'
>&lcRuncmd
>RETURN
>
>
>Thanks for bringing this to our attention!
Charlie
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform