Where is the READ EVENTS command?
>I'm new to using VFP to build a COM server.
>
>A VFP DLL server seems pretty straight forward. But, since I want my server to be able to interact with the user via a form, I understand that I need to create my VFP server as an EXE.
>
>I have used VFP 9 new application wizard to create the framework for my VFP EXE COM. I have added two files in this application. Right now, the content of these files is just test code to work out the strategy.
>
>The first file is a simple form (FrmTestFormFromCOM) that just displays a message, along with an OK button whose Click method releases the form.
>
>The 2nd file is a PRG file where I define the class that I am exposing. Here is the test code in that file
>
>
>DEFINE CLASS PatVisitsDat AS Custom OLEPUBLIC
>
>PROCEDURE GetDatFilesFromPatVisits (sDataSource AS String) AS Variant
>
> CREATE DATABASE "C:\Temp\WorkingDB.dbc"
>
> MESSAGEBOX("Before do form")
> DO FORM FrmTestFormFromCOM TO lResult
> MESSAGEBOX("After do form")
> CLOSE DATABASES
> MESSAGEBOX("After Close Databases")
> DELETE DATABASE "C:\Temp\WorkingDB.dbc" DELETETABLES
> RETURN
>ENDPROC
>
>ENDDEFINE
>
>
>In the form's Init method, I have also added a MessageBox() call.
>I then build the project as an EXE COM and register it.
>
>In a separate VFP form, I create test code that instantiates my server and calls the GetDatFilesFromPatVisits() method.
>When I run the test code, I see all of the MesageBox messages including the one in the form. I also get a message asking if I really want to delete the database. But, I never see the form.
>Apparently the form has run and was released, but I don't see anything.
>
>The VFP documentation is very vague about how to create a VFP EXE COM application.
>
>Thanks in advance for your help.
>Jim
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer