Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Create DLL called from VB showing a form
Message
 
 
To
18/05/2001 17:22:50
Pamela Bulmahn
The University of Iowa
Iowa, United States
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00509001
Message ID:
00509061
Views:
15
This message has been marked as a message which has helped to the initial question of the thread.
>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.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform