Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Need multi-select File Open dialogue
Message
 
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
01222666
Message ID:
01222870
Views:
32
Actually I just experimented on another machine doing what you describe (i.e., without using the test I described), and the app bombed because COMDLG32.OCX had not been installed/registered on that machine. If that OCX is not registered, then MSComDlg.CommonDialog is not available, and an OLE error will be thrown when the form containing the control is instantiated.

The conclusion I reach is that a VFP app can not assume that MSComDlg.CommonDialog will be available unless the VFP installer you provide (for your own app) contains the OCX as a to-be-installed component. There is no guarantee that COMDLG32.OCX (aka MSComDlg.CommonDialog) already is installed on any given machine.



>Mark,
>
>I think you're doing unnecessary work. You need to visually place the control into container and save it as a class. Then use this class on your form. This way it is going to work.
>
>Or you can visually place it on the form where do you need to use it.
>
>GetFile() does not use this control.
>
>Finally, I've created my own form for picking up files based on a mask, in a specific directory. It uses Frank Dietrich IconBuddy class in order to show associated icons.
>
>I hope Frank will update his entry in Downloads section here and will include both forms (one using ListView ActiveX and another using grid control).
>
>>>You have to put control on the form anyway or you'll get licensing error in runtime (mskb #Q192693).
>>
>>Thanks Sergery. Let me ask one final question... as I'm not sure just how pervasively available is MSComDlg.CommonDialog.
>>
>>What if I try to open a form with the MSComDlg.CommonDialog control on it, but the machine does not have the control installed. Is that even possible (and still the system be functional?).
>>
>>I have tried this, and it seems to work:
>>&& Here, G_CanUseCommonDlg is a public var that starts out at zero.
>>&& It gets set once in the app as a flag
>>&& to indicate that MSComDlg.CommonDialog is available:
>>IF EMPTY(G_CanUseCommonDlg)
>>  G_CanUseCommonDlg=1
>>  LOCAL oOleComDlg
>>  TRY
>>    oOleComDlg=CREATEOBJECT("MSComDlg.CommonDialog.1")
>>  CATCH
>>    G_CanUseCommonDlg=2
>>  ENDTRY
>>  oOleComDlg=.null.
>>ENDIF
>>By doing this, I know if G_CanUseCommonDlg equals 1, that MSComDlg.CommonDialog.1 is available and my app won't throw an error when I open the form upon which the Control is placed. By the way, I set the form's LEFT property to -500 in the Init so the form itself is not visible. Then in its Activate event, I do the code to set up the OleControl and invoke its ShowOpen() method. This seems to work OK.
>>If G_CanUseCommonDlg equals 2, then I just default to VFP's GetFile() function.
>>
>>What I don't know is if GetFile() uses MSComDlg.CommonDialog anyway, so that all this checking I'm doing is not necessary.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform