Thanks, Sergey. I'll give that a try!
>Try this
oDlg = Createobject("GetFileEx")
>? oDlg.GetFile()
>
>DEFINE CLASS GetFileEx AS form
> Left = 100
> Top = 100
> Name = "GetFIleEx"
> DoCreate = .T.
> Visible = .F.
> ADD OBJECT oCDC AS OleControl WITH ;
> OleClass = "MsComDlg.CommonDialog"
>
> PROCEDURE GetFile(tnInitColor)
> LOCAL lnColor
> Thisform.oCDC.ShowOpen()
> ENDPROC
>ENDDEFINE
It will also prevent error described in
BUG: License Error with ActiveX Control Added at Run-Time mskb #
192693.
>BTW, this control is in comdlg32.ocx
>
>>I am trying to write something to replace the standard FoxPro GetFile(), because I need some additional functionality. I have been using
>>
loOleControl = CREATEOBJECT("MSComDlg.CommonDialog")
>>...
>>loOleControl.ShowOpen()
>>lcFilename = loOleControl.FileName
>>
>>This works well, but I have two problems.
>>1. The open dialog window isn't centered. It is in the upper corner of the screen.
>>
>>2. It works great on my W2K system, but a user with Win98 didn't find the required OCX. I looked in my registry and MSComDlg.CommonDialog points to \WINNT\SYSTEM\COMDLG16.OCX. Great! So I sent it to him. But this OCX doesn't have a REGSVR32 entry point (or whatever it needs), and I don't know how to get it installed on his system... if that's what I should do.
>>
>>Should I be doing something different if I want generic code?
>>
>>TIA. Tom
Tom Green in Montreal