Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
NewObject gives me an error: Object name is invalid
Message
De
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:
00559546
Vues:
17
This message has been marked as the solution to the initial question of the thread.
: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 :)

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