Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Object name is invalid (Error 1575)
Message
De
09/07/1999 14:41:33
Kenneth Downs
Secure Data Software, Inc.
New York, États-Unis
 
 
À
09/07/1999 14:14:55
Rex Mahel
Realm Software, Llc
Ohio, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00239552
Message ID:
00239570
Vues:
20
Rex,

Hmmmm. I'm puzzled. I do this all the time without a problem, but just a little differently. Specifically, I always call the current control "control1" no matter what class it is. So my code might look like this:

FOR EACH loColumn in This.Columns
loColumn.RemoveObject(loColumn.CurrentControl)
loColumn.AddObject("control1","MyControl")
loColumn.control1.visible = .t.
loColumn.CurrentControl = "control1"
ENDFOR

It may be as well that VFP is "forgetting" the current control when you remove it, and that you need to explicitly assign it again. One wouldn't think this is necessary, but perhaps you've discovered something here.


>FOR EACH loColumn IN This.Columns
> lcColumnControlName = loColumn.CurrentControl)
> loColumn.RemoveObject(lcColumnControlName)
> loColumn.AddObject(lcColumnControlName,"MyControl")
loColumn.CurrentControl = loColumnControlName
loColumn.

>ENDFOR



>All,
>
>I am getting the above error while executing the AddObject line in the following code. The control and the control name should be gone after executing the RemoveObject line, but I get an invalid name when attempting to use that name again.
>
>FOR EACH loColumn IN This.Columns
> lcColumnControlName = loColumn.CurrentControl)
> loColumn.RemoveObject(lcColumnControlName)
> loColumn.AddObject(lcColumnControlName,"MyControl")
> STORE .T. TO ("loColumn." + loColumn.CurrentControl + ".Visible")
>ENDFOR
>
>Has anyone seen this behavior before?
>
>TIA
>
>Rex
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform