Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Automation Server
Message
 
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00179438
Message ID:
00180233
Views:
30
Hi Dore,

Just to add my $0.02 worth, you are correct and this hasn't changed in VFP6. For a test, I created a COM object in VFP6 and tried instantiating it and running certain methods in a VB6 app. Everything worked great except for the line where I tried to use MESSAGEBOX() because it needs to be Visible.

>Bob,
>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 out the class (based upon it's type library) will be registered and available for access by other applications. Now try instantiating this class in a VB application. Just try to make the form visible. It can't be done because it has no visual interface. It may be possible to instantiate this class in VFP and make it visible but in that case VFP is providing the visibility not the Olepublic class.
>Let's be honest. We're not creating Olepublic classes to be used in VFP. We're creating them to be used outside of VFP. If the only intended developers for these classes are using VFP we don't need Olepublic classes, any old VFP classes will do.
>Am I missing something obvious here?
>-Dore
>
>>> Let me see if I understand. In order to create an Automation Server with a visual interface, I create a project and in that project, I create the necessary data classes, form classes, etc., just like I was creating a stand-alone application. Next, if I have a form that has some custom properties that I want to expose to others, I need to make that particular form OLEPUBLIC. I do not have to make all other classes OLEPUBLIC. Finally, I build the project selecting the Build .EXE setting.
>>
>>Correct... VFP should also create a type library. After the build if you pull up Project Info and go to the servers tab, you should see the Automation servers name and attributes.
>>
>>
>>> Assuming I have correctly followed what you are saying to this point, my next question is how do you call and run the visual application after you have built it? I did something similar to what you are suggesting, but, I made each of my classes OLEPUBLIC. After I built the .exe, I checked the Registery and each class was listed. When I tried to run the application via oTest = CREATEOBJECT(), my computer got hung up and I could not do anything except stop the process on the .exe. (NT4/SP3)
>>>
>>
>>You would, as you said, createobj passing the OLEServer name and the class to instantiate. You might have an initial form or class that controlls things.
>>
>>oX = createobject('MyServerName.MyClass')
>>
>>oX.DoThisMethod() && Will excute 'dothismethod' of MyClass
>>
>>From here you can check properties if you want...
>>
>>if oX.Error == OK
>> blah blah
>>endif
>>
>>Ox = null && this will shut down the automation server
>>
>>BOb
Colin Magee
Team Leader, Systems Development
Metroland Media Group Ltd.
Mississauga, Ontario, Canada

cmagee@metroland.com

Never mistake having a career with having a life.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform