是什么原因导致此错误? “运行时错误 380:属性值无效”

发布于 2024-08-15 23:40:56 字数 172 浏览 7 评论 0 原文

几年前我们使用vb6.0和SQL server 2000开发了一个应用程序。 最近,我们的一些客户告诉我们,在运行该应用程序时,在一些使用 Winxp sp2 作为操作系统的计算机上,当他们想要显示搜索表单时,他们会收到以下错误:

“运行时错误 380:无效的属性值“

是什么原因导致这个错误?

we had developed an application using vb6.0 and SQL server 2000 a few years ago.
recently, some of our customers tell us that while running the application, on some of computers which use Winxp sp2 as their O/S, they get the following error when they want to show the search form:

"Runtime error 380: Invalid property value"

What causes this error?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(14

∞觅青森が 2024-08-22 23:40:56

我认为您的应用程序使用屏蔽编辑框?这是一个相对众所周知的问题,Microsoft 在此记录了:

http://support.microsoft.com/kb/ 177088

文章提到了 VB4 和 5,但我很确定 VB6 也是如此。

编辑

在进一步的研究中,我也发现了其他控件对这个问题的引用。在 Windows XP 上为运行 XP 的用户重新编译应用程序可能会为他们生成一个工作版本,尽管这不是一个理想的解决方案...

I presume your application uses a masked edit box? This is a relatively well known problem, documented by Microsoft here:

http://support.microsoft.com/kb/177088

The article refers to VB4 and 5, but I am pretty sure the same is true for VB6.

EDIT

On further research, I am finding references to this problem with other controls as well. Recompiling your application on Windows XP for users that are running XP will probably produce them a working version, though it's not an ideal solution...

A君 2024-08-22 23:40:56

顺便说一句:根据我的经验,导致此错误的另一个常见原因是 Form_Resize 事件中的代码,该事件使用数学来调整表单上控件的大小。控件尺寸(HeightWidth)无法设置为负值,因此 Form_Resize 事件中的以下代码可能会导致此错误:

Private Sub Form_Resize()
    'Resize text box to fit the form, with a margin of 1000 twips on the right.'
    'This will error out if the width of the Form drops below 1000 twips.'
    txtFirstName.Width = Me.Width - 1000
End Sub

如果将表单大小调整为宽度小于 1000 缇,则上述代码将引发“属性值无效”错误。如果这是问题所在,最简单的解决方案是将 On Error Resume Next 添加为第一行,以便忽略此类错误。这是 VB6 中罕见的情况之一,On Error Resume Next 是您的朋友。

Just to throw my two cents in: another common cause of this error in my experience is code in the Form_Resize event that uses math to resize controls on a form. Control dimensions (Height and Width) can't be set to negative values, so code like the following in your Form_Resize event can cause this error:

Private Sub Form_Resize()
    'Resize text box to fit the form, with a margin of 1000 twips on the right.'
    'This will error out if the width of the Form drops below 1000 twips.'
    txtFirstName.Width = Me.Width - 1000
End Sub

The above code will raise an an "Invalid property value" error if the form is resized to less than 1000 twips wide. If this is the problem, the easiest solution is to add On Error Resume Next as the first line, so that these kinds of errors are ignored. This is one of those rare situations in VB6 where On Error Resume Next is your friend.

醉城メ夜风 2024-08-22 23:40:56

是什么原因导致运行时错误 380?尝试将对象或控件的属性设置为不允许的值。查看搜索表单加载时运行的代码(Form_Load 等),查找将属性设置为依赖于运行时值的内容的任何代码。

我的其他建议是添加一些错误处理和一些日志记录以追踪导致错误的确切行。

  • 日志记录 在代码中添加“Got to X”、“Got to Y”等语句。使用这些语句可以找到错误的确切位置。您可以写入文本文件或事件日志或使用输出调试字符串
  • 错误处理以下是如何获取错误的堆栈跟踪。向可能涉及的每个例程添加一个错误处理程序,如下面的代码。基本的免费工具 MZTools 可以自动执行此操作。您还可以使用 Erl 报告行号并找到确切的行 - MZTools 可以自动为您输入行号。

_

 On Error Goto Handler
   <routine contents>   
 Handler: 
   Err.Raise Err.Number, "(function_name)->" & Err.source, Err.Description 

What causes runtime error 380? Attempting to set a property of an object or control to a value that is not allowed. Look through the code that runs when your search form loads (Form_Load etc.) for any code that sets a property to something that depends on runtime values.

My other advice is to add some error handling and some logging to track down the exact line that is causing the error.

  • Logging Sprinkle statements through the code that say "Got to X", "Got to Y", etc. Use these to find the exact location of the error. You can write to a text file or the event log or use OutputDebugString.
  • Error handling Here's how to get a stack trace for the error. Add an error handler to every routine that might be involved, like this code below. The essential free tool MZTools can do this automatically. You could also use Erl to report line numbers and find the exact line - MZTools can automatically put in line numbers for you.

_

 On Error Goto Handler
   <routine contents>   
 Handler: 
   Err.Raise Err.Number, "(function_name)->" & Err.source, Err.Description 
怪异←思 2024-08-22 23:40:56

我在用于日期的屏蔽编辑框控件中遇到了同样的问题,该错误是由于窗口区域设置中的日期格式属性造成的。将“M/d/yyyy”更改为“dd/MM/yyyy”,一切顺利。

I had the same problem in masked edit box control that was used for Date and the error was due to Date format property in Region settings of windows. Changed "M/d/yyyy" to "dd/MM/yyyy" and everything worked out.

那些过往 2024-08-22 23:40:56

如果您编写软件或使用编写的软件存储启动程序时要重新使用的程序窗口坐标或大小,请检查是否存在可能导致这种情况的此类大小和位置。我一次又一次地看到各个供应商懒惰地生成代码,这些代码根据“窗体”(程序窗口)的大小调整控件的大小和重新定位“窗体”(程序窗口)上的控件。查看 HKLM\Software\Vendor\Program 和 HKCU\Software\Vendor\Program。查找可能有问题的特定键。我曾经有一个程序存储 -48000,用于在名为 WindowsPosX 和 WindowPosY 的键中存储程序窗口位置。您可以在任务栏上看到程序启动并运行,但由于程序窗口本身小于 48000(-48000 的绝对值),因此它完全位于屏幕之外。如果您不习惯编辑注册表信息(大多数人不习惯),请卸载该软件,使用注册表清理程序删除所有剩余条目,然后重新安装该软件,看看是否不能解决问题。

If you write software, or use software written, which stores program window coordinates or sizes to be resused when starting a program, check there for any occurrence(s) of such sizes and positions which would be causing this. I've seen it time and time again from various vendors lazily producing code which resizes and repositions controls on a "form" (a program window) based on the size of said form. Look in HKLM\Software\Vendor\Program and HKCU\Software\Vendor\Program. Look for specific keys which might be offending. I once had a program store -48000 for the program window position in keys called WindowsPosX and WindowPosY. You could see the program start and running on the taskbar but since the program window itself was smaller than 48000 (the absolute value of -48000), it was positioned completely off the screen. If you're not comfortable with editing regstry information - most people aren't - then uninstall the software, use a registry cleaner to remove any leftover entries then reinstall the software and see if that doesn't fix the problem.

那些过往 2024-08-22 23:40:56

许多非常愚蠢的事情都可能导致此错误。我遇到的字体是 Windows 8 默认情况下不再包含的字体 - Courier New。 VB6 应用程序的名称以一种形式硬编码,因此启动时会显示消息。

Many really silly things can cause this error. The one I've encountered is a font no longer included with Windows 8 by default - Courier New. The VB6 application had its name hard-coded in one of the forms, hence the message on start-up.

一刻暧昧 2024-08-22 23:40:56

老线程,但这是一个答案。

voyager

ie 的字体有问题。如果您安装了一些 corel 套件,请删除一些语言选项。
我们用进程监视器对此进行了挖掘,找到了原因,对我们来说就是这两个字体文件。

DFKai71.ttf
dfmw5.ttf

我们遇到了同样的问题,通过从 windows\fonts 文件夹中删除这两个字体文件来修复它。

Old thread, but here is an answer.

Problematic fonts with voyager

ie. if you install some corel suite, drop some language options away.
We dig through this with process monitor and found the reason, with us it was these two font files.

DFKai71.ttf
dfmw5.ttf

We had same problem and it was fixed by removing these two font files from windows\fonts folder.

不疑不惑不回忆 2024-08-22 23:40:56

看起来上面的答案适用于您编写和编译程序时的情况,但我使用的是供应商的软件 Catalog.exe,它是 Voyager 卡目录的一部分“Ex Libris”,我也收到错误:

catalog-error.png http ://img805.imageshack.us/img805/8275/catalogerror.png

我有两台 Windows 7 32 位计算机。较新的给我错误,但在较旧的上运行正常。我在谷歌上做了很多研究,以下是我发现人们所说的与这个问题相关的一些内容。也许这些事情之一将帮助您修复错误,尽管它们对我不起作用:

根据其他人的说法(例如 David M),我认为它可能与 MSVBM60.DLL 库有关 -但在我的两台计算机上,这个文件似乎是完全相同的(相同的版本、大小、日期等)。

由于该文件没有不同,我尝试查找应用程序可以使用的其他(dll)文件,因此我启动了 Process Explorer by Sysinternals 并查看了该应用程序(它会加载,然后当您告诉它“连接”时崩溃),下面的屏幕截图是我发现的。

screen1.png http://img195.imageshack.us/img195/2231/screen1oo.png

screen2.png http://img88.imageshack.us/img88/2153 /screen2ao.png

screen3.png

现在,我不是一个 Windows/VB 程序员,只是一个高级用户,所以我对该怎么做已经一无所知了。我已经与软件供应商交谈过,他们建议重新安装 Windows。这可能会起作用,但让我感到烦恼的是,这个程序可以在 Windows 7 上运行,但这个特定系统上的某些东西导致了错误。最后,这是一个已经部署在多台计算机上的映像,因此虽然重新安装一次 Windows 并不是什么大问题,但如果我能找到修复或解决方法,将会节省我一些时间。

Looks like the answers above are for when you are writing and compiling a program, but I'm using a Vendor's software, Catalog.exe, part of the Voyager card catalog by "Ex Libris" and I'm getting the error as well:

catalog-error.png http://img805.imageshack.us/img805/8275/catalogerror.png

I have two Windows 7 32-bit machines. The newer one is giving me the error but on the older one it runs fine. I have done a lot of research with Google and here are some of the things I've found that people are saying related to this issue. Maybe one of these things will help fix the error for you, although they didn't work for me:

From what others are saying (like David M) I think it could be related to the MSVBM60.DLL library - but it appears that on both of my computers this file is the exact same (same version, size, date, etc).

Since that file wasn't different I tried to find what other (dll) files the application could be using, so I launched Process Explorer by Sysinternals and took a look at the application (it loads and then crashes when you tell it to "connect"), and the screenshots below are what I found.

screen1.png http://img195.imageshack.us/img195/2231/screen1oo.png

screen2.png http://img88.imageshack.us/img88/2153/screen2ao.png

screen3.png

Now, I'm not a Windows / VB programmer, just a power user, and so I'm about at the end of my knowledge for what to do. I've talked to the software vendor and they recommend reinstalling Windows. That will probably work, but it just bugs me that this program can run on Windows 7, but something on this particular system is causing errors. Finally, this is an image that has been deployed on multiple machines already and so while re-installing Windows once is not a big deal it would save me some serious time if I could figure out a fix or workaround.

神也荒唐 2024-08-22 23:40:56

我认为,问题的根本在于,程序是在什么版本的操作系统下编译的,在什么版本的操作系统下运行的。
我见过很多更新的 dll 和 ocx 文件会导致类似的错误,特别是当程序在旧版本的 dll 和 ocx 文件下编译并且在设置过程中保留最新的 dll 和 ocx 文件时。

I think, basically the problem lies in the fact, as to under what version of the O/S has the programme been compiled and under what version of the O/S are you running the programme.
I have seen a lot of updated dll and ocx files causing similar errors, especially when the programme has been compiled under older version of the dll and ocx files and during set up the latest dll and ocx files are retained.

花开柳相依 2024-08-22 23:40:56

可能是您在屏幕中定位了屏幕边框之外的控件(标签、框架、文本......)。
如果某些控件的位置取决于任何变量,并且该变量在开始时未正确定义,则可能会出现此错误消息。

可能两台计算机的屏幕分辨率不同。这可能就是原因。

为了找到程序错误,请将此行放入所有子程序中:
on error resume next

如果这解决了问题,您必须逐一清除每个子程序中的这一行,并验证问题是否再次出现。当在具体子程序中删除此行后问题再次出现时,您将知道存储错误的子例程。在那里搜索,你就会找到它。

[电子邮件受保护]

Could be you are locating in the screen a control (label, frame, text..) out of the screen borders.
If the position of some control depends of any variable, and that variable is not correctly defined at start, you may have this error message.

May be you have different screen resolution in both computers. And that could be the reason.

in order to find the program bug, put this line in all subs:
on error resume next

if this correct the problem, you must clear this line in every sub, one by one, and verifying if the problem returns. When the problem returns after removing this line in a concrete sub, you will know the subroutine that stores the bug. Search there and you will find it.

[email protected]

通知家属抬走 2024-08-22 23:40:56

造成此错误的原因之一是代码中出现非常愚蠢的错误。
如果没有将正确的值传递给 ActiveX 的属性,也会引发此错误。

就像空值传递给 Font.Name 属性或文本值传递给 Height 属性一样。

One reason for this error is very silly mistake in code.
If proper value is not passed to a property of ActiveX, then also this error is thrown.

Like empty value is passed to Font.Name property or text value is passed to Height property.

浴红衣 2024-08-22 23:40:56

2017 年我知道...但是有人在代码维护期间遇到了这个问题。

当我尝试时发生此错误:

maskedbox.Mask = "#.###"
maskedbox.Text = "12345678"

要解决此问题,只需将 PromptInclude 属性设置为“false”即可。

2017 I know... but someone is facing this problem during their code maintenance.

This error happened when I tried:

maskedbox.Mask = "#.###"
maskedbox.Text = "12345678"

To fix that, just set PromptInclude property to "false".

゛时过境迁 2024-08-22 23:40:56

我们在一个项目中遇到了这个错误,该项目对于许多用户来说在许多操作系统上都运行得很好。只有一个系统出现此错误。结果将系统上的任何合法字体分配给 Form.fontname 都会生成此错误。只是添加到可能原因的列表中。

We got this error in a project that runs perfectly well on many OSs, for many users. Just one system gave this error. Turned out assigning any legal font on the system to Form.fontname generates this error. Just adding to the list of possible causes.

墨离汐 2024-08-22 23:40:56

错误 380 Windows 7 解决方案非常简单,只需检查您的日期时间和时间即可区域设置是否正确。

error 380 windows 7 solution very easy just check your date time & regional setting do them correct.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文