>I have a requirement to generate data from VFP for a scheduling process written in VB. The VFP program must ask the user for some information to determine the type of information to send back. The VFP program needs to be a .DLL rather than an .EXE so that the VB program will wait for the VFP process to complete before resuming execution.
>
>I have written the data collection logic, can call it from the VB routine and can get data back, but... I can not figure out how to communicate with the user from the VFP program to get the selection criteria.
>
>The program that I have written creates a class based on custom and is OLEPublic. I attempted to add a form to the class and added the form objects in code, which seem to have been created but it will not show. I get an error if I try to use the Show method and simply making it visible doesn't do anything.
>
>I then tried to use a messagebox but it errors on "User Interface option not allowed at this time."
>
>I know this can be done, but I can't figure out how.
>
>Thank you in advance for any help you can provide.
>Pamela.
This can't be done using VFP as a COM DLL. Only COM EXEs can have UI associated with it. You can create a COM EXE to do this. EXEs operate outside the current process but depending on what you do, control does not have to immediately return to the calling process.
Create a COM EXE that contains a method to display a form to gather the information. Configure the form as Modal (WindowType=1). From the VB application, instantiate the VFP server and execute the method. The VB application should pause while the form is displayed. When the information is entered, store it to some object properties so you can read them from the VB app.
HTH.
Larry Miller
MCSD
LWMiller3@verizon.netAccumulate learning by study, understand what you learn by questioning. -- Mingjiao