×

Loading...
Ad by
  • 最优利率和cashback可以申请特批,好信用好收入offer更好。请点链接扫码加微信咨询,Scotiabank -- Nick Zhang 6478812600。
Ad by
  • 最优利率和cashback可以申请特批,好信用好收入offer更好。请点链接扫码加微信咨询,Scotiabank -- Nick Zhang 6478812600。

Help! 请教在VB中使用控件的问题:

打开VB项目文件,程序提示一个控件有一个新版本,问是否升级:

1,选择升级,提示这个控件Could not be loaded(不能装载)

2, 选择不升级,在使用控件时:
Class not registered.
(控件的类没注册)
Looking for object with CLSID:{1234567890}
需要控件CLSID:{1234567890}

我在注册表中看到这个控件的clsid确实是{1234567890},我在注册表HKEY_CLASSES_ROOT下删去这个控件,然后重新注册这个控件,还是不能使用这个控件。

1,请问原因?

2,如何彻底把控件的新旧版本注册信息删除,使程序装载控件时,不再提示新旧版本问题?

3,在注册表中删除控件是否只是在HKEY_CLASSES_ROOT下?
Sign in and Reply Report

Replies, comments and Discussions:

  • 工作学习 / IT技术讨论 / Help! 请教在VB中使用控件的问题:
    打开VB项目文件,程序提示一个控件有一个新版本,问是否升级:

    1,选择升级,提示这个控件Could not be loaded(不能装载)

    2, 选择不升级,在使用控件时:
    Class not registered.
    (控件的类没注册)
    Looking for object with CLSID:{1234567890}
    需要控件CLSID:{1234567890}

    我在注册表中看到这个控件的clsid确实是{1234567890},我在注册表HKEY_CLASSES_ROOT下删去这个控件,然后重新注册这个控件,还是不能使用这个控件。

    1,请问原因?

    2,如何彻底把控件的新旧版本注册信息删除,使程序装载控件时,不再提示新旧版本问题?

    3,在注册表中删除控件是否只是在HKEY_CLASSES_ROOT下?
    • up
      • help!!!!!!!
      • I had same problem before ...
        I had same problem before when I used a component that was created
        by other guy in my company, the reason was that this component calls another component, and that component was not compatitable with the component, so I re-compiled that component and register it, that is it.
    • Is this your control, or a third-party control?
      • It was made by another developer in my company, but he is gone
        • one thing to check is to see if the binary compatiblity is set in the project. instead of direct going into registry, try to use regsvr32 to unregister the ocx file,
          recompile the control, then use regsvr32 to register it.
          In your vb project, remove and add back the reference.
          • 控件是project Compatibility
            我从新编译后,注册,打开程序,程序还是提示一个控件有一个新版本,问是否升级

            1,选择升级,提示这个控件Could not be loaded(不能装载)

            2, 选择不升级,在使用控件时:
            Class not registered.
            (控件的类没注册)
            Looking for object with CLSID:{1234567890}
            需要控件CLSID:{1234567890}

            现象如旧
            • 从程序中删掉控件,去掉参照。然后再加回来。另外,应该设成binary compatibality
              • I am trying, thanks.
              • binary compatibality --编译,注册--打开程序--提示控件不能装载,不管继续--remove control--从新加入control--提示有新版本是否升级--
                1,升级,控件不能装载;2,不升级,控件装载(在工具栏可见),但不能加入窗体中。help!!!!!!!!!!!!!!!
                • 试试新建一个小Project, 一个窗口,就用这一个控件,看能不能用?
                  • 如果能用,我觉得还是你全来项目中的引用没清干净。如果不介意,可否拿vbp文件看一下?
                    • OK, how can I contact you? I prefer to contact you by phone.
                      • I'm in U.S. Are you? You can mail me to red7male@msn.com.
                  • 不能用
                • 另一种可能性是否是 该控件中引用了其它的dll呢。
                  • Yes, 这个控件引用了另一个控件.
                    • 查一下什么控件?注册
                      • 还是不行.痛苦!!!!!!!!!
                        这个控件编译生成ocx,很简单(只包括一个UserControl),他的引用和部件(一个dll,一个ocx)都在(都已注册),编译也通过,就是不能使用.加入窗体中提示class not registered. Looking for object with CLSID:{******************************}
                        • 你能否告诉我它引用的是什么控件。
                          • stdole2.tib vb6.olb msvbvm60.dll \3 msvbvm60.dll 还有一个自编的dll; 还有一个自编的ocx
                            • 我觉得这几个应该没有问题。继续查一下自编的ocx和dll 用了什么? 我怀疑他引用了有些vb光盘上的东西,如:mswless.ocx等activex control. 如果你无法打开他的ocx, 试注册一些vb光盘中带的控件。
                            • 这个自编的Dll和Ocx又引用什么了?
                              • dao3.51, 好象都是正常的
                                • 你的vb升过service pack 吗? 你访问的是什么数据库?
                                  • this DAO3.51 is kind of old (back to vb5 world) and I don't think it will work together with Win2K or Office 2000--- was the control written in vb 5? Anyway, I recommend you upgrade to DAO 3.6.
                                    • I will try to upgrade VB, thanks. I will tell you what's going on
                                      • after you upgrade vb, make sure the control refer to 3.6 instead of 3.51
                                        • 还是不行,在注册表中已看到这个控件,用的时候就说没注册
                                          • 你确定是dao360的问题么?你可以说一下你的这个控件的功能,然后判断一下他用了什么vb里的active x控件。如果你有vb6安装盘,可以安装其中的common controls(忘记确切的目录名了)下的一些active x控件
                                            • 控件很简单,弹出一个窗口,给一些参数共用户修改,保存关闭。
                                              • 我猜测可能是MSWLESS.OCX,你试试吧。从vb6盘里找到这个文件,拷贝到你的机器上,click 右0键,merge一下。(仅猜测)
                                          • 继续倒推吧。我记得你测试过你要使用的控件,即使是在一个小测试程序里也用不了,对吧。
                                            咱们继续下去,那个控件不是引用了另外一个控件吗?再来一个小测试程序,单用另外的那个控件,看能不能用,逐步逼近吧。
                                            • the others work very well
                                              • 那个DLL呢?也单试试,如果也工作,还是DAO最可疑。你确认你已经把参照改成3。6了?若都不是,我猜你的VB环境有问题...
                                                对了,那个DLL是vb还是vc写的?
                                                • all were made by VB
                                                  • Has the control ever worked for you before?
                                                    • Yes. It works before. This project has 15 controls made by us.
                                                      But just this one can not work now. I still think some thing is wrong with windows register, but I try to using this control with another computer, also can not works.
                                                      • Then probable the interface of some public methods in the control (or the dll) have been changed. You told me the control doesn't have binary-compitability set before.
                                                        Chaning in the interface causes a new version of the control. I wonder if your registry has multiple (broken) version of the control installed.
                                                        I recommend you clean up the registry first. Search by the program id, and locate all entries.
                                                        Then recompile the control again, use regsvr32 to register it (be sure the control it refers to have been registerd first).
                                                        • 我把控件的原程序加入主程序形成工作组,控件原程序工作没问题,分开编译后就不行。
                                                          • 那就是注册的问题,很可能是有多个版本在注册表中。在VB工作组中引用的是项目文件,而不是编译后的控件
                        • is it using mdac? The control it referred also coded in VB? which version?
                          • I didn't find this reference
                  • yes, good point. If you can't use the control even in a simple project, then probably means your control is missing some supporting dlls.
                    • I will check it, thanks. Keep in touch.