什么可能导致Vb6运行时错误430 [英] What could cause Vb6 run time error 430

查看:1363
本文介绍了什么可能导致Vb6运行时错误430的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个COM dll写在vb6。当我尝试从这个dll创建一个类模块的新对象时,我得到一个运行计时器错误430:类不支持自动化或不支持预期的接口。有趣的是,这只发生在IDE外部,当我从IDE中调试时没有抛出错误,并且类的新对象被成功创建。可能是什么原因?

I have a COM dll written in vb6. When I try to create a new object of a class module from this dll I get a Run timer error 430: Class does not support automation or does not support expected interface. The interesting thing is that this happens only from outside the IDE, when I am debugging from within the IDE there is no error thrown and the new object of the class is created successfully. What can be the cause?

一般来说,我偶尔会得到这些类型的错误在COM DLL。调试COM问题的最好方法是什么?我如何知道当程序运行时使用的dll的路径?

In general I occasionally get these kind of errors in COM dlls. What is the best way to debug COM issues? How can I know the path of the dll that is being used when a program is running?

推荐答案

如果这个项目完全VB6。可能的原因是EXE在它的目录中有一个DLL二进制文件的副本。当您启动它使用该副本而不是编译副本。当你ADD方法或类的EXE变得与旧的DLL不兼容。如果你做了一个错误修复或只是与内部代码,然后EXE将运行,但它使用的旧DLL。

If this project is entirely in VB6. The likely cause of this is that the EXE has a copy of the DLL binary in it's directory. When you fire it uses that copy instead of the compiled copy. When you ADD methods or classes that EXE becomes incompatible with the old DLL. If you did a bug fix or just worked with the inside code then EXE will run but it used the old DLL.

将您的DLL设置为二进制兼容性。
确保你有一个Compatible目录。
把最后版本的DLL放在那里。
将二进制兼容性指向该DLL。
确保你的EXE编译到它的项目目录。
从它的项目目录运行EXE。这样,它将使用您编译的DLL。
您需要编写一个实用程序,以便可以单独编译每个项目。
使用虚拟PC或其他计算机测试您的设置。

Set your DLL to Binary Compatibility. Make sure you have a Compatible directory. Put the DLL of the Last version in there. Point the Binary Compatibility to that DLL. Make sure your EXE compiles to it's project directory. Run the EXE from it's project directory. That way it will use the DLL that you compiled. You need to write a utility so that you can compile every project separately. Test your setup using Virtual PC or another computer.

所有这些步骤将有助于避免DLL Hell。我自己的项目有6个层次的两打ActiveX项目。当我采用上面的我的DLL地狱问题几乎没有什么。

All these steps will help to avoid DLL Hell. My own project has two dozen ActiveX projects in 6 layers. When I adopted the above my DLL Hell problems dropped to almost nothing.

这篇关于什么可能导致Vb6运行时错误430的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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