Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Reuse VFP code in .NET?
Message
General information
Forum:
Visual FoxPro
Category:
Visual FoxPro and .NET
Miscellaneous
Thread ID:
01061588
Message ID:
01062394
Views:
17
>>I don't think this is really a workable approach. If you have .SPR files you probably have state on those forms that you need to set up and manage, and that will become a real nightmare in a hurry. You can do that, but it'll be a totally unmaintainable mess where you talk to form controls instead of methods of the form that can act independently.
>>
>
>Can I use the SCX as an entry point rather than the SPR? The SPR basically does a security level check and then invokes the form. The rest of the SPR consists of procedures called by the form. Obviously the SCX would have to be modified to handle incoming parameters and invoke appropriate methods, and to not show itself. What else am I missing? Probably a whole host of things that happen under the hood when a form runs in a VFP environment....

It's just not a good idea to do this. It's easy enough to instantiate a form and call methods on it, but it's unlikely that you can just call methods. You probably have to call a Click() method to make something happen, and the Click() probably relies on values that are on the form. The control code probably writes its results back nito the form or worse into MessageBoxes or other dialog from time to time - all of that needs to be addressed! All of it a maintenance nightmare. If you have to go through the pain of cleaning up the form code anyway I would highly recommend breaking out that code into separate objects and re-writing that code - using as much of the business logic as you can but re-writing nevertheless.
+++ Rick ---

West Wind Technologies
Maui, Hawaii

west-wind.com/
West Wind Message Board
Rick's Web Log
Markdown Monster
---
Making waves on the Web

Where do you want to surf today?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform