Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Assign UDF to documentFile property on an oleControl
Message
De
07/07/1998 17:30:31
Nancy Folsom
Pixel Dust Industries
Washington, États-Unis
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00114635
Message ID:
00115066
Vues:
23
Well, from the docs and my testing, I don't *think* it'll work for an _olecontrol_ because you can only set DocumentFile in code when you create the object. The init happens too late. I know I tried somthing similar early on, and while I may have had a different problem altogether, I don't think it's legal.

What's odd to me is that I can

DEFINE CLASS oleexcelobject AS olecontrol
documentFile = GetFile()
...etc

but I couldn't do
DEFINE CLASS oleexcelobject AS olecontrol
documentFile = Get_File()
...etc

Oh, well, I ended up just adding a worksheet based on the template I want and (hokey) force the user to save it before going on.

>I there any reason not to call Get_File() from the init? This works:
>
>DEFINE CLASS testO as line
> DocumentFile = ""
>
>PROCEDURE get_file
> LOCAL cf
> cf = getFile('XLS')
> IF NOT FILE( cf )
> RETURN ""
> ENDIF
> RETURN cf
>endproc
>
>procedure init
> if !dodefault()
> return .f.
> endif
> this.DocumentFile = this.Get_File()
>endproc
>
>ENDDEFINE
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform