<p>I have a foxpro app, that contains hard coded path for icons and bitmaps. That's how foxpro does it and there is no way around it. And this works fine, except that when a removable drive has been used but is not connected, and when is connected windows assigns the same letter as hard coded path, when opening any form that contains such path, the following error message apears (<strong>FROM WINDOWS</strong>, not fox):</p>

<p>Windows-No disk
Exception Processing Message c0000012 Parameters .....</p>

<p>Any help please
Nelson Marmol</p>

[{'answer_id': 56487, 'author': 'PabloG', 'author_id': 394, 'author_profile': 'https://Stackoverflow.com/users/394', 'pm_score': 2, 'selected': False, 'text': '<p>Nelson:</p>\n\n<p>"That\'s how foxpro does it and there is no way around it"?</p>\n\n<p>I\'m using FOX since FoxPro 2.5 to Visual FoxPro 9, and you are NEVER forced in any way to hard-code a path, you can use SET PATH TO (sYourPath), you can embed the icons and bitmaps in your EXE / APP file and therefore there\'s no need of including this resources externally.</p>\n\n<p>You say that you have a "Foxpro App": which version? Old MS-DOS FoxPro o Visual FoxPro?\nIf you\'re using VFP 8+, you can use SYS(2450, 1):</p>\n\n<pre><code>Specifies how an application searches for data and resources such as functions, procedures, executable files, and so on. \n\nYou can use SYS(2450) to specify that Visual FoxPro searches within an application for a specific procedure or user-defined function (UDF) before it searches along the SET DEFAULT and SET PATH locations. Setting SYS(2450) can help improve performance for applications that run on a local or wide area network.\n\n\nSYS(2450 [, 0 | 1 ])\n\n\n\nParameters\n0 \nSearch along path and default locations before searching in the application. (Default)\n\n1 \nSearch within the application for the specified procedure or UDF before searching the path and default locations.\n</code></pre>\n\n<p>One quick workaround could be assign another letter to your USB via the Disk Manager.</p>\n'}, {'answer_id': 56515, 'author': 'robsoft', 'author_id': 3897, 'author_profile': 'https://Stackoverflow.com/users/3897', 'pm_score': 0, 'selected': False, 'text': '<p>I agree with @PabloG - it\'s been over a decade since I worked with FoxPro (Dos &amp; Windows) but even back in FPW2.6 you could determine where your app was running \'from\', set absolute or relative search paths and even bundle your resources straight into the "compiled" (heh) exe. All of our resources lived in a specific subfolder within the app folder, the database files in another subfolder also below the app folder. We used relative paths for everything as I recall.</p>\n\n<p>Can you give us a bit more information about the problem?</p>\n\n<p>If you think it would be helpful I could try and dig out some of our FPW2.6 code where we\'re doing this kind of thing. :-)</p>\n'}, {'answer_id': 56726, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 0, 'selected': False, 'text': '<p>It\'s VFP8 and sorry if I did not explained myself corectly. Also I think "there\'s no way around it" may sounded bad. What I meant is the property "<strong>ICON</strong>" in the forms. Since we have each component type separated in folders (forms,reports, menus, icons, etc), if you try to make the path relative, next time you edit the file, foxpro will include the fullpath. This problem started recently and we found that our clients started using external usb drives as means for backups.</p>\n'}, {'answer_id': 63279, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 0, 'selected': False, 'text': '<p>It sounds to me like you are distributing the forms/reports/labels etc to the clients. If you build an EXE, then you shouldn\'t get the "path" problem as VFP will embed the resource (in this case icon) into the exe and will know how to extract it at runtime.</p>\n\n<p>Peterson</p>\n'}, {'answer_id': 133256, 'author': 'nmarmol', 'author_id': 20448, 'author_profile': 'https://Stackoverflow.com/users/20448', 'pm_score': 0, 'selected': False, 'text': "<p>No, we are no distributing forms or anything with the app... it's an exe. I forgot to mention that the EXE is compressed and obfuscated with <strong>KONXIZE 1.0.</strong></p>\n"}, {'answer_id': 1150726, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 0, 'selected': False, 'text': '<p>Assuming your application can determine the path to the icon file at runtime, then in the load event of the form, you can set the icon with:</p>\n\n<pre><code>THIS.Icon=&lt;path to file&gt;\n</code></pre>\n'}, {'answer_id': 1685207, 'author': 'nstenz', 'author_id': 203656, 'author_profile': 'https://Stackoverflow.com/users/203656', 'pm_score': 0, 'selected': False, 'text': '<p>If anybody else runs across this, you can generally type something like this for the Icon property in the Properties window to force it to be evaluated, which will probably prevent the path auto-filling:</p>\n\n<p><strong>="icon.ico"</strong></p>\n\n<p>instead of just <strong>icon.ico</strong>.</p>\n'}]
['https://Stackoverflow.com/questions/56430', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/-1/']