>The truth is I'm sorry I got involved in this thread and I'm talking about my >experience with VFP5 not VFP6 so things may have changed, but I doubt it. Try >the following. I have and it just doesn't work. Create a class based upon >the form base class, make it simple, just change the background color of it to >something unique and check the Olepublic check box. Add it to a project where >this form based class in instantiated. Build the exe or dll. As you point
Ok.. I just did it and it works.
1. It HAS to be a .EXE... as .DLL is an In-Process server and those CAN NOT have a UI.
2. Are you sure it didn't work... if there is no wait state or read events in your class then the form would dissapear as fast as it appears.
Here is what I did...
Create a form class...
Make BackColor Red
set ShowWindow to As-Top-Level-Form (very important)
Put a Label on it that said Hi There
Put a Command Button
In the command button Click put: Clear events
Ok.. then I created dummy.prg which I put the following code...
define class MyClass as custom olepublic
function ShowForm()
local oX
oX = createobj('testform')
oX.Show()
read events
enddefine
*********
Compile the project as an .EXE
**********
First I tested it in Foxpro with the following code in test.prg
local oX
oX = createobj('vistest.myclass')
oX.showform()
wait window 'Hey There'
**********
that worked fine... then, I closed VFP went into VB 6.0.. wrote the following code:
Sub main()
Dim TestForm As Object
Set TestForm = CreateObject("vistest.myclass")
TestForm.ShowForm
End Sub
*******
I ran the code, and Viola... the VFP form came up.
****************************
Now... it CAN be done... I have done it... of course... Terry and others... I do agree with Dior and others that if you want to create a Business Component to market, make it without a UI... let whoever buys the component from you create the UI... You just provide the business service in your .DLL that it is you are selling.
But, once again, if you want to provide the UI, you can do it, just compile it as an .EXE and make sure to use As-Top-Level forms.
BOb
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement