Content deleted Content added
consistent terminology. rm unnec pipes. |
CortexFiend (talk | contribs) Link suggestions feature: 3 links added. |
||
Line 33:
==Startup disk==
Some "[[copy protection|copy-protected]]" programs look for a particular file on a [[floppy disk]] or flash drive on startup to verify that they are not unauthorized copies. If the computer is replaced by a newer machine, which doesn't have a floppy drive, the program that requires it now can't be run since the floppy disk can't be inserted.
This last example shows why hard coding may turn out to be impractical even when it seems at the time that it would work completely. In the 1980s and 1990s, the great majority of PCs were fitted with at least one floppy drive, but floppy drives later fell out of use. A program hard-coded in that manner 15 years ago could face problems if not updated.
Line 41:
===Profile path===
Some Windows programs hard code the profile path to developer-defined locations such as <code>C:\Documents and Settings\''Username''</code>. This is the path for the vast majority of [[Windows 2000]] or above, but this would cause an error if the profile is stored on a network or otherwise relocated. The proper way to get it is to call the <code>GetUserProfileDirectory</code> function or to resolve the <code>%userprofile%</code> [[environment variable]]. Another assumption that developers often make is assuming that the profile is located on a local hard disk.
===My Documents folder path===
Some Windows programs hard code the path to <code>[[My Documents]]</code> as <code>''ProfilePath''\My Documents</code>. These programs would work on machines running the English version, but on [[internationalization and localization|localized]] versions of Windows this folder normally has a different name. For example, in Italian versions the <code>My Documents</code> folder is named ''Documenti''. <code>My Documents</code> may also have been relocated using Folder Redirection in [[Group Policy]] in Windows 2000 or above. The proper way to get it is to call the <code>SHGetFolderPath</code> function.
==Solution==
|