# Converting Foxpro DOS to Windows



## Servant1975 (Feb 9, 2004)

My wife's boss has asked if I would be willing to make their foxpro DOS database program (do not know version yet) compatible with windows. I have do some programming, but not in foxpro, how difficult would this be?


----------



## AbvAvgUser (Oct 3, 2002)

From whatever little knowledge I have about the fundamental difference in way DOS and Windows work, it won't be a very easy task. If I have to do this, I would prefer writing from scratch in Visual Basic.

To start with, you will have to re-write the whole user interface. 
@ row,col say and @ row,col get doesn't work in Windows. So many display and user input objects are changed. And once you change them, you will have to also re-write how data is updated to and from database. 

Secondly, .dbf files will have to converted to SQL or Access format. That wouldn't be much difficult, a simple import may do the trick.


----------



## Aftab (Oct 15, 2003)

Another option might be to convert the program to Visual Foxpro, this way you may not have to do much recoding, maybe none at all for the user interface etc...


----------



## AbvAvgUser (Oct 3, 2002)

I don't agree with Aftab. User Interface under DOS was drastically different from under interface under Windows. There are so many objects which didn't exist then. If you just convert, things may not work as expected and may turn out to be quite shabby and unreliable.

Secondly, under DOS, the programming was sequential. Under Windows it is event based. The whole concept is different. Windows allows multi-tasking (or at least emulates it smartly). DOS didn't allow that completely. There you could open only one application at a time, exception being TSR (Terminate and Stay Resident) applications.

For the same application to work as a true Windows compliant applications, I would strongly recommend coding from scratch. May be you don't have to devote too much time on application planning and designing because a working skeleton is already present. But you can't just convert and expect it to work efficiently.


----------



## suffolksilv (Jan 23, 2004)

I wrote a complex DOS Foxpro database for a company ten years ago and it is still running well from a server on a network with a mixture of ME, 98 and XP pro machines. I have considered converting it to Visual Foxpro and have experimented with that. It seemed to accept all the commands without change. But the DOS version has worked well for this long and 'it ain't broke so...' It has megabytes of data now. My one problem is that on the XP machine the screens are squahed up in the top half. Can anyone help with that ? Compatibility doesn't help. I may try the Micosoft Compatibility kit but it is a 12 Meg download.


----------



## bobmack (Jun 22, 2005)

I did the same thing a couple of years ago for a small business. I was able to import the database into Access and write the app entirely in Access. I wouldn't wont to do this if you're talking about a large amount of data though. 
Good Luck!


----------



## classicsoftw (Jul 1, 2005)

The answer to the original question is it depends. If the system is hard coded, then it is much more of a challenge. If the DOS version is written 2.5 or 2.6 and was written with screens, it will easily convert to windows and just some beautification will be required.


----------



## jwhart (Jul 13, 2005)

suffolksilv said:


> My one problem is that on the XP machine the screens are squahed up in the top half. Can anyone help with that ? Compatibility doesn't help. I may try the Micosoft Compatibility kit but it is a 12 Meg download.


Problem is the fact that Microsoft changed the screen buffer size for DOS Windows from 25 lines to 50 lines. To fix start regedit. Go to HKEY_CURRENT_USER\Console. Change the ScreenBufferSize key to the same value as the WindowSize key (190050 in Hex)


----------

