Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
NewObject gives me an error: Object name is invalid
Message
 
 
À
21/09/2001 17:53:42
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00559510
Message ID:
00559575
Vues:
12
>:code in Page2.Activate:
>>
>>********************************************************************
>>*  Description.......: Page2.Activate
>>*  Calling Samples...:
>>*  Parameter List....:
>>*  Created by........:
>>*  Modified by.......: Nadya Nosonovsky 05/31/2000 05:41:31 PM
>>********************************************************************
>>thisform.dataenvironment.initialselectedalias="IndxDict"
>>select IndxDict
>>with this
>>	if type("this.ContIndxPage")<>"O"
>>		.newobject("ContIndxPage","IndxDictPage","ddwg.vcx")
>>		with .ContIndxPage
>>			.top=5
>>			.left=20
>>			.visible=.t.
>>			set step on
>>			local loColumn, lcCaption
>>			for each loColumn in .grdIndxDict.Columns
>>		     lcCaption = loColumn.Header1.Caption
>* You need to comment this line:
>>		     loColumn.removeobject('Header1')
>>		     loColumn.NewObject('Header1','myheader','myheader.prg',,m.lcCaption)
>>		next
>>		endwith
>>	endif
>>	.refresh()
>>	thisform.navstand.navupdate()
>>	thisform.navstand.lstOrders.enable()
>>	.ContIndxPage.grdIndxDict.setfocus()	
>>endwith
>>
>>Line with NewObject generates an Error : Object name is invalid (Error 1575)
>
>When you remove a header from a column, it automatically creates a new one - seems to be a column must have a header. OTOH, there can be only one, so when you add a new header object (with a different name!) the old one is destroyed. You can rename it back then if you need to.
>
>This is tested and works in my code for several months now. Took me a few hours to figure out what's going on :)

Thanks, I'll try on Monday or during this weekend through PCAnywhere. The strange thing is, that the same code works fine on the first page (there grid is not created on the fly). Too bad, that Header class should be created in a program and so there is no way to change headers in design time...
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform