0

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 (FROM WINDOWS, not fox):

Windows-No disk Exception Processing Message c0000012 Parameters .....

Any help please Nelson Marmol

4

7 回答 7

2

Nelson:

"That's how foxpro does it and there is no way around it"?

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.

You say that you have a "Foxpro App": which version? Old MS-DOS FoxPro o Visual FoxPro? If you're using VFP 8+, you can use SYS(2450, 1):

Specifies how an application searches for data and resources such as functions, procedures, executable files, and so on. 

You 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.


SYS(2450 [, 0 | 1 ])



Parameters
0 
Search along path and default locations before searching in the application. (Default)

1 
Search within the application for the specified procedure or UDF before searching the path and default locations.

One quick workaround could be assign another letter to your USB via the Disk Manager.

于 2008-09-11T13:06:46.460 回答
0

如果其他人遇到此问题,您通常可以在“属性”窗口中为 Icon 属性键入类似的内容以强制对其进行评估,这可能会阻止路径自动填充:

="图标.ico"

而不仅仅是icon.ico

于 2009-11-06T03:20:41.513 回答
0

不,我们没有分发表格或应用程序的任何内容......它是一个 exe。我忘了提到 EXE 是用KONXIZE 1.0 压缩和混淆的。

于 2008-09-25T13:16:53.623 回答
0

I agree with @PabloG - it's been over a decade since I worked with FoxPro (Dos & 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.

Can you give us a bit more information about the problem?

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. :-)

于 2008-09-11T13:23:02.317 回答
0

在我看来,您正在向客户分发表格/报告/标签等。如果您构建一个 EXE,那么您不应该遇到“路径”问题,因为 VFP 会将资源(在本例中为图标)嵌入到 exe 中,并且知道如何在运行时提取它。

彼得森

于 2008-09-15T14:15:52.080 回答
0

这是 VFP8,如果我没有正确地解释自己,我很抱歉。另外我认为“没有办法解决它”可能听起来很糟糕。我的意思是表格中的属性“ ICON ”。由于我们将每个组件类型分隔在文件夹中(表单、报告、菜单、图标等),如果您尝试使路径相对,下次编辑文件时,foxpro 将包含完整路径。这个问题最近开始出现,我们发现我们的客户开始使用外部 USB 驱动器作为备份手段。

于 2008-09-11T14:42:37.930 回答
0

假设您的应用程序可以在运行时确定图标文件的路径,那么在表单的加载事件中,您可以使用以下方式设置图标:

THIS.Icon=<path to file>
于 2009-07-19T19:54:28.453 回答