Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Assign UDF to documentFile property on an oleControl
Message
 
To
06/07/1998 14:21:56
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00114635
Message ID:
00114716
Views:
23
>I'd like to call my own GetFile wrapper (?) function, called Get_File() when I create my Excel OleControl object. I've tried a UDF in the PRG, and in a class method. I can call GETFILE() fine. I can assign the UDF return to a public variable in the prg, and set documentfile = myPublicVar.
>
>I don't want to use a public, but I will if I have to. Any suggestions?
>
>TIA
>
>DEFINE CLASS oleexcelObject as OLEControl
> oleTypeAllowed = 0
> OleClass ="excel.sheet.8"
> height = 170
> top = 0
> left = 0
> DocumentFile = GetFile() && This works, but file must exist
>*!* DocumentFile = this.getFile() && "Date type is invalid for this property."
> PROCEDURE get_file
> LOCAL cf
> cf = getFile('XLS')
> IF NOT FILE( cf )
> RETURN ""
> ENDIF
> RETURN cf
>ENDDEFINE

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
----------
Mark Bucciarelli
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform