Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to close Class Designer window programmatically
Message
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
How to close Class Designer window programmatically
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01066052
Message ID:
01066052
Views:
75
Hi everybody,

I'm writing a very simple program to update one of the property in all class library programmatically. Once I activate the class designer window, I can not close it. Here is my code, how can I fix it? Or may be this could be written more elegantly?
*  Program...........: UPDATEPROPERTY.PRG
*  Author............: Nadya Nosonovsky                   
*  Project...........: Visual Collections                 
*  Created...........: 11/07/2005  11:43:24
*  Copyright.........: (c) Jzanus, 2005
*) Description.......: 
*  Calling Samples...: 
*  Parameter List....: 
*  Major change list.: 

LPARAMETERS tcLibrary, tcProperty, tuValue

IF EMPTY(tcLibrary)
   tcLibrary = GETFILE('vcx')
ENDIF

IF EMPTY(tcProperty)
   tcProperty = "StatusBarText"
ENDIF

IF EMPTY(tuValue)      
	tuValue = [" "]
ENDIF

LOCAL laClasses[1], arrObj[1]
LOCAL lnClasses, lnI, loObject

lnClasses =AVCXCLASSES(laClasses, m.tcLibrary)	

FOR lnI =1 TO lnClasses
   MODIFY CLASS (laClasses[m.lnI,1]) OF (m.tcLibrary) nowait
   =ASELOBJ(arrObj,1)
   loObject = arrObj[1]

	IF VARTYPE(m.loObject) = "O"
		IF PEMSTATUS(m.loObject,m.tcProperty,5)		
		   m.loObject.WriteExpression(m.tcProperty, m.tuValue)
*		   STORE m.tuValue TO (m.loObject + "." + m.tcProperty)
		endif   
	ENDIF
	ACTIVATE WINDOW "Class Designer" 
	KEYBOARD '{CTRL+W}'
 NEXT
Thanks in advance.
If it's not broken, fix it until it is.


My Blog
Next
Reply
Map
View

Click here to load this message in the networking platform