Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Assign UDF to documentFile property on an oleControl
Message
From
07/07/1998 17:30:31
 
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00114635
Message ID:
00115066
Views:
22
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform