pradeep
pradeep

Reputation: 3095

Coding an application so that it runs properly on windows 7...?

I have a flash drive which has an application whose code is written VC++ 2008 , the application works fine in xp , but the problem arises when i plug in the drive to a windows 7 machine , it doesn't run properly. is there any way that i can make it compatible to windows by writing a code.

i dont want to set the compatibility tab in windows 7 to run the program..

i want to code it in the program , more like a patch.

Upvotes: 1

Views: 261

Answers (3)

Billy ONeal
Billy ONeal

Reputation: 106530

You can use the Microsoft Application Compatibility Toolkit, which will tell you exactly which Windows XP compatibility shims are used by your code when you run your application under Windows XP mode.

You simply run your application and disable various shims until your code once again behaves incorrectly. The last shim you disabled is the cause of the incorrect behavior. You can then research the exact consequences of each shim as well as exactly what your code will have to do to fix the bugs it has that force it to run in Windows XP Compatibility Mode.

Upvotes: 2

M. Williams
M. Williams

Reputation: 4985

If you know that the problem exists and know that UAC / etc ... / Manifest on Win7 don't solve your problem and that it's not connected with 32/64 bit issues, try a different approach.

I guess you know what goes wrong with your app on Windows 7. If you're not sure exactly, at least you should know where (in which logical block) your problem is located (e.g IO block, Disk read/write block, Gui, etc.

Now stick to the debugger. Hope your program isn't that big that you can't analyze it and find the source of your problem. You could have your problems because of some functions working not as expected or something like that.

Then, I guess, you could rethink / remanage your code and change it the way it works on both platform. If there is no universal solution, use #ifdefs to determine your current platform (the worst case actually, because you would have to have different binary files for different windows versions).

Upvotes: 0

Jason Williams
Jason Williams

Reputation: 57892

You probably need to add an Application Manifest to your application to request the appropriate security permissions to allow your application to do what it needs to do.

This may cause a UAC prompt to be shown to the user if elevated permissions are needed, but then your code will be allowed to do whatever Windows 7 is currently blocking.

Upvotes: 1

Related Questions