Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to display Locfile() dialog with _screen=OFF
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00437609
Message ID:
00437646
Views:
19
>>>>I have an executable that runs with screen=off (set in config.fpw). There aren't any forms in the program. My MESSAGEBOXES display with the screen off, however if my code hits a LOCFILE() it doesn't show the file selection window and the program hangs. I can set _screen.visible = .t. right before the locfile() and I can then see the Locfile() dialog. Then I can set _screen.visible = .F. immediately thereafter. However, this looks kind of cheesy to me. I'd rather keep the VFP screen hidden the entire time. Getfile() responds the same way. Any quick and easy way around this?
>>>
>>>Jim,
>>>
>>>Sometime in the past, there was a discussion trying to figure out why this occurs. We surmized (a SWAG to be sure) that the cause was the dialog was inheriting the visibility status of its parent window, in this case the _SCREEN. The Common Dialog ActiveX control, which calls the same DLL that LOCFILE(), GETFILE(), and PUTFILE() do, doesn't suffer from this problem. In this case, you're going to have to either roll your own LOCFILE() using the common dialogs, or be satisfied with the "cheesy" solution.
>>
>>Thanks George. Haven't used the common dialogs before so it won't be quick, but it's better than "cheesy."
>
>You're welcome, Jim. The control is pretty old (I ran into it first in VB 3, I think), stable, and works well in VFP. In some ways, it's far more flexible than the native functions (you can specify and initial directory, for example, by setting a property). Once you get the hang of it, it's easy to work with. Naturally, if there's a question or problem, there are plenty of UTers here to help.

Well, since you offered...<grin>

I dropped it on a test form tried calling it as such:

lctest = thisform.olecontrol1.showopen(), but I don't get a return value that way. How do I get the return value? Also, what are the properties that I need to set to specify the file name and the extension to simulate the LOCFILE() function?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform