Server 2008 R2上的旧VB6 OCX问题 [英] Old VB6 OCX problem on Server 2008 R2

查看:87
本文介绍了Server 2008 R2上的旧VB6 OCX问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我们公司,我们有一个旧的VB6应用程序,基于COM +和ADO 2.6。我们的一位客户最近开始抱怨我们的应用程序无法在Windows Server 2008 R2上运行。

为了重现该场景,我们使用Windows Server 2008创建了一个VM并安装了该应用程序(作为管理员)。该应用程序完美。但随后我们在计算机上与另一个用户(User_1)一起登录,并收到以下消息:

339 - 组件'MSCOMCTL.OCX'或其中一个依赖项未正确注册:文件丢失或者是无效的。

我们的第一个想法是:缺乏权限。

为了测试这个理论,我们将User_1添加到管理员组。它没用。经过一些尝试,我们再次安装了应用程序,记录为User_1。该应用程序开始为User_1和管理员正常工作。但是,当尝试访问User_2时,我们收到了相同的消息。

我们的结论是:如果我们与用户一起安装应用程序,它对他有用。对于其他用户,它不起作用。因此,可能在安装过​​程中,应用程序会配置只有该用户才能看到的内容。

在上网时,我们发现Windows Server 2008 R2与此OCX兼容( http://msdn.microsoft.com/en-us/vbrun/ms788708.aspx )。我们一直试图找到这种行为背后的原因。
任何人都有建议吗?

解决方案





组件MSCOMCTL.OCX或其某个依赖项未正确注册

解决方案1:

MSCOMCTL.OCX是Microsoft Library Windows Common Controls文件。有时,当Windows用户安装或卸载一堆软件时,某些Microsoft库可能会被取消注册。一个可能损坏或丢失的文件是MSCOMCTL.OCX文件。然后,当用户运行需要或依赖于此文件的程序或应用程序时,可能会出现以下错误:


组件'MSCOMCTL.OCX '或其中一个依赖项未正确注册:文件丢失或无效MSCOMCTL.OCX错误屏幕截图:

如何更正或修复此依赖性错误:


1. 首先搜索你的MSCOMCTL.OCX的本地驱动器,看它是否是 失踪。该文件的路径通常为:C:\ WINDOWS \ system32(或)通常为C:\ Winnt \ system32 \ COMDLG32.OCX

2. 如果文件丢失,可以下载


3. 下载后,单击MSCOMCTL.exe并将文件解压缩到C:\ WINDOWS \ system32目录(或)C:\\ \\ winnt \ system32 \ COMDLG32.OCX


< span style ="font-family:'Verdana','sans-serif';颜色:#333333; font-size:8.5pt">注意:有些用户可能需要执行此额外步骤来注册文件:


1. 单击开始 - >运行并键入 REGSVR32 MSCOMCTL.OCX

解决方案2
:最好的选择是使用打包和部署向导....
<但是,如果您想通过代码手动注册它们,请使用此...

私有子Form_load()
Shell" REGSVR32 / sc: \ winnt \system32 \mstask32.ocx"
结束次


谢谢和最诚挚的问候.Anil Inampudi。


< span style ="font-family:Calibri">示例代码免责声明


< span style ="font-family:'Lucida Console'; font-size:10pt">



注意 - 免责声明



使用以下材料或示例代码即表示您同意遵守以下许可条款和Microsoft合作伙伴计划协议,其条款通过引用并入本文。这些许可条款是Microsoft Corporation(或者,如果适用,基于您所在地,其关联公司)与您之间的协议。我们提供给您的任何材料(示例代码除外)仅供您内部使用。提供任何示例代码仅用于说明目的,并非旨在用于生产环境。我们授予您非独家,免版税的使用和修改示例代码的权利,并复制和分发示例代码的目标代码形式,前提是您同意:(i)不使用Microsoft的名称,徽标或商标销售您的软件,其中嵌入了示例代码; (ii)在您的软件产品中包含有效的版权声明,其中嵌入了示例代码; (iii)代表分包商并为分包商的利益提供免责声明,免除间接和后果性损害的责任以及责任的责任限制; (iv)对使用或分发样本代码而产生或导致的任何第三方索赔或诉讼(包括律师费)的Microsoft,其附属公司和供应商进行赔偿,保护无害和保护。


-----



In our company, we have an old VB6 application, based on COM+ and ADO 2.6. One of our customers recently started to complain that our application does not work on Windows Server 2008 R2.

To reproduce the scenario, we created a VM with Windows Server 2008 and installed the app (as administrator). The app worked perfectly. But then we logged with another user (User_1) on the machine, and we received the following message:

339 - Component 'MSCOMCTL.OCX' or one of its dependencies not correctly registered: a file is missing or is invalid.

Our first thought was: lack of permissions.

To test this theory, we added User_1 to the administrator's group. It didn't work. After some tries, we installed the app again, logged as User_1. The app started to work normally for User_1 and administrator. But then, when trying to access as User_2, we received the same message.

Our conclusion is: If we install the app with the user, it works for him. For another user, it does not work. So, probably, during installation the app configures something that only that user can see.

Seaching the internet, we found that Windows Server 2008 R2 is compatible with this OCX (http://msdn.microsoft.com/en-us/vbrun/ms788708.aspx). We've been trying to find the reason behind this behaviour.

Anyone has a suggestion?

解决方案

 

 Hi,

Component MSCOMCTL.OCX or one of its dependencies not correctly registered


Solution 1:

MSCOMCTL.OCX is a Microsoft Library Windows Common Controls file. Occasionally when a Windows user is installing or uninstalling a bunch of software, certain Microsoft Libraries can become unregistered . One such file that can become corrupt or lost is the MSCOMCTL.OCX file. Then, when the user runs a program or application that requires or is dependent on this file, they may be presented with the following error:

Component 'MSCOMCTL.OCX' or one of its dependencies not correctly registered: a file is missing or invalid MSCOMCTL.OCX error screenshot:

How to Correct or fix this dependency error:

1.         First search your local drive for MSCOMCTL.OCX to see if it is missing. The path to the file is typically: C:\WINDOWS\system32 (or) typically C:\Winnt\ system32\COMDLG32.OCX

2.         If the file is missing you can download it

3.         Once downloaded, click the MSCOMCTL.exe and extract the file to your C:\WINDOWS\system32 directory (or) C:\Winnt\ system32\COMDLG32.OCX

Note: Some users may need to perform this additional step to register the file:

1.         Click Start -> Run and type REGSVR32 MSCOMCTL.OCX

Solution 2
:well the best alternative is to go with Package and deployment wizard....

But, If you'd like to register them manually through the code then use this...

Private sub Form_load()
Shell "REGSVR32 /s c:\winnt\system32\mstask32.ocx"
End Sub


Thanks and Best Regards
Anil Inampudi.

Sample Code Disclaimer

 

 

NOTE - Disclaimer

 

By using the following materials or sample code you agree to be bound by the license terms below and the Microsoft Partner Program Agreement the terms of which are incorporated herein by this reference. These license terms are an agreement between Microsoft Corporation (or, if applicable based on where you are located, on of its affiliates) and you. Any materials (other than sample code) we provide to you are for your internal use only. Any sample code is provided for the purpose of illustration only and is not intended to be used in a production environment. We grant you a nonexclusive, royalty-free right to use and modify the sample code and to reproduce and distribute the object code form of the sample code, provided that you agree: (i) to not use Microsoft's name, logo, or trademarks to market your software produced in which the sample code is embedded; (ii) to include a valid copyright notice on your software product in which the sample code is embedded; (iii) to provide on behalf of and for the benefit of your subcontractors a disclaimer of warranties, exclusion of liability for indirect and consequential damages and a responsible limitation of liability; and (iv) to indemnify, hold harmless, and defend Microsoft, its affiliates and suppliers from and against any third party claims or lawsuits, including attorney's fees, that arise or result from the use or distribution of the sample code.

-----

 


这篇关于Server 2008 R2上的旧VB6 OCX问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆