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:
01062526
Views:
27
>>>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.
>

All right, all right, I accept that the approach my boss wants is probably not going to work.

This may sound like a setup but is Web Connection something we should consider for this job? The ability to interface between a web form and VFP code is built in, so having to build COM interfaces or whatever is one major headache I think WC would allow me to avoid. Our existing code is full of references to VFP memvars (some set earlier in the app) and form PEMs, all of which would have to be rewritten, but it might give me a leg up. I don't need a PhD in corporate politics to know they do NOT want to throw away or redesign the existing VFP code. The timeframe is too short.

I really appreciate your input on this.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform