“Error in loading DLL” when compiling DLL in VB6

2019-04-27 13:16发布

问题:

I have a visual basic 6 ".dll project" that uses references and when "File->Make dll" option is clicked, it should generate a dll file. Well, when clicked "File->Make dll", I get error "Error in loading DLL".

How can I see which references are missing?

回答1:

Under Project -> References.

Look for the word MISSING: in front of the dll's that aren't there.



回答2:

I've seen this error occur when referenced components are recompiled with no compatibility but the previous versions of the dlls are not unregistered beforehand, so the registry keys for the typelibs are not removed and these bogus registry entries point to the new dlls.

Usually I deal with these with an internal registry cleaner tool that can remove typelibs/clsid/interfaces registration based on typelib disk location. You can try moving physical files of the referenced projets to different location on disk and regsvr32 them there, manually remove references from the project file, restart the IDE and reopen project, finally add references and check that dll location in add reference dialog points to the new files location.



回答3:

If you have no MISSING references then try compiling the libraries of the project using project compatibility instead of binary compatibility. VB6 can get confused with Binary compatibility when there are multiple libraries being reference in a hierarchy of libraries.



回答4:

It's been a while but from the top menu - "Project" -> "References" and the missing ones are usually highlighed or say missing next to them.



回答5:

In Project -> References, double-check the Location of all your references. Your reference might have the right name but could be pointing to another instance of the same DLL.



标签: vb6