Aleniko


Hi everyone; I hope you don't mind the pre historic question:

I have an older app written in FPD2.6.

On some new machines, the app will freeze up roughly a few times a day. It always happen when the user clicks a 'popup'.

Any one experienced this Any ideas where to start

I am in the process of updating my app to VFP but it will take some time and I would want the old app to be as problem free as possible.

Thanks again,

AK.




Re: Older Foxpro Dos freezing on XP.

Rick Borup


We recently had a similar problem, an older FPD 2.6 app froze up multiple times a day on the client's new computers. Their new computer were the first machines they had acquired with Windows XP, but it turns out that was a red herring. The new machines were also dual-core CPU's, and we solved the problem by modifying the NT virtual DOS machine to use only one processor. I don't know if that applies in your situation, but if it does and you want details on the solution please post back here and ask.





Re: Older Foxpro Dos freezing on XP.

Aleniko

Thank you so much. I think this is exactly my problem because it happens on Dual Cores.

Can you post some details regarding how I make XP use only one processor

AK.






Re: Older Foxpro Dos freezing on XP.

Rick Borup

To make sure this solution works before making a permanent change, you can set the processor affinity at runtime by locating the Windows virtual DOS machine ntvdm.exe in Task Manager while the DOS app is running, Right-click and choose Set Affinity, then un-mark either CPU 0 or CPU 1. This will persist until you terminate the app. If the app runs without freezing after you do this then this is probably the solution you need and you can proceed to make the permanent change as outlined below.

To set the processor affinity permanently you need to use a utility called imagecfg to modify the Windows virtual DOS machine ntvdm.exe which is located in the %system% folder (e.g. system32). When I was researching this problem I found several references to imagecfg on the Web, but to give credit where credit is due the one that was most helpful to me was Mark Wilson's blog entry at http://www.markwilson.co.uk/blog/2005/01/troubleshooting-ms-dos-application.htm.

First you have to download a utility called imagecfg.exe. It's evidently a Microsoft utility, but I could not find it for download on the MS site. However I did find it at http://www.robpol86.com/Pages/imagecfg.php. This appears to be the legitimate tool and it worked for me, but as with any download, use at your own risk. A search will turn up other download sources for this utility, too.

What we did was to run imagecfg.exe with the -u parameter to change ntvdm.exe to uni-processor mode, as in imagecfg.exe -u ntvdm.exe. Note that this modifies the executable file ntvdm.exe, and as Mark points out in his blog post, Windows File Protection will complain about this and will attempt to restore the original file from the dll cache, so you have to change it there also. Being cautious, I started out by making a copy of ntvdm.exe in a temporary folder, running imagecfg on that, then copying it to the dll cache and the system folder.

We did not find it necessary to run imagecfg with the -a option to set affinity to a particular processor. In our case running it with -u to set uni-processor mode was sufficient. In other words, it did not matter which of the two processors ntvdm.exe uses as long as it uses only one.

Hope this was clear enough. I would be interested in knowing if this solves your problem.

-Rick






Re: Older Foxpro Dos freezing on XP.

dni

It is a "exe" file or "app" file What "exe" file name are you using




Re: Older Foxpro Dos freezing on XP.

Rick Borup

The solution I posted involves using imagecfg.exe (the utility program) to modify ntvdm.exe (the Windows virtual DOS machine). You do not have to change anything in your FoxPro for DOS app or exe.




Re: Older Foxpro Dos freezing on XP.

Aleniko

Thanks for the detailed solution. I will be testing this today, and will let you know.

Thanks again!!!

AK.




Re: Older Foxpro Dos freezing on XP.

Aleniko

Indeed a solution!

A million thanks. Now I can postpone upgrading my users to VFP for another 5 years... Joking of course.

AK.




Re: Older Foxpro Dos freezing on XP.

Rick Borup

Indeed a solution!

A million thanks. Now I can postpone upgrading my users to VFP for another 5 years... Joking of course.

AK.

You're welcome, and thanks for confirming that this solution worked for you. Good luck to you going forward and keeping that app running for however long your customer wants it!

-Rick