开发者

Visual Basic 6 project lost reference to all user-defined types and will not compile

I committed some working, compiling additions to Subversion using TortiseSVN one day ago, closed down Visual Basic 6.0 (SP6), and today when I opened the project, the IDE will not compile the project.

The error that I receive is: Compile Error: User-defined type is not defined.

Also, when I try to go to the definition of ANY type, say MSComm or Byte, I get the message: Identifier under cursor is not recognized.

The on开发者_开发百科ly changes to the VBP files that I see using the TortiseSVN diff viewer are the additions of the Class files that I added.


Are these types within the same project? If not, check the project references. They are referred through registry keys, which may have been changed outside the scope of the project.

Are you building a dll component or ActiveX exe (in contrast to a Forms exe)? If so, try unregistering the previous build.

If you have binary compatibility enabled in the project settings, VB6 will look for the previous build to resolve symbols. Maybe you removed the previous build, or it is somehow broken. Disable binary compatiblity and delete the previous build, then try to recompile. (Don't forget to unregister if it's a component, otherwise you'll leave your registry littered with broken class keys.)

[edit] Clarifications:

With checking the project references I mean the menu in the IDE. The list will say if it can't find a reference (if it was already marked as added) in the registry. Yes, those are the ones in the vbp, but with a text editor you don't really see if the GUID/version still exists. They might change if the referenced component is updated/patched.

With the registry becoming littered I mean that if you compile without project/binary compatibility then VB6 will generate new GUIDs for your classes. Public classes are noted in the registry with the path to the dll. Normaly VB6 unregisters a dll before overwriting it, but if you manually delete the previous build nobody is going to unregister it, so the class info stays in the registry, referencing a dll which no longer exists.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜