3
votes

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 only changes to the VBP files that I see using the TortiseSVN diff viewer are the additions of the Class files that I added.

1
What do you mean, "Visual Studio"? If you're using VB6, then you're not using Visual Studio. - John Saunders
You're right, Visual Basic 6.0 (SP6), not Visual Studio - Matt
@John Saunders: VB6 is a part of VS6. (Notice the present tense. Software does not cease to exist just because it is discontinued as a product.) - pyon
@Eduardo: why assume i was referring to whether the software is available for sale? I was referring to the fact that VB6 is a separate executable that has nothing to do with Visual Studio. Was it ever even packaged along with VC++ and Interdev and the package called "Visual Studio"? Too long ago for me to remember. - John Saunders
@John Saunders: Yep, it was so packaged. It even included Visual FoxPro! (Although imagining a plausible scenario in which VFP would be actually useful has always eluded me.) I will not deny the fact Visual Studio 6 is not even nearly as cohesive as subsequent versions of Visual Studio. But I remember writing COM components in C++ to use them in VB (yes, 6), and the set of tools I used was usually called "Visual Studio". - pyon

1 Answers

1
votes

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.