VB6 compilation from command line

冷暖自知 提交于 2019-12-04 06:01:50
cmsjr

Known bug:

SYMPTOMS

When you use command line arguments to compile a Microsoft Visual Basic project that contains WebClass designers, you may encounter errors.

CAUSE

When you use the command line argument /MAKE to compile the application, if the associated .DCA files for the Designers (.DSR) are not in the same directory as the .DSR files, you may encounter errors during the compiling. The .DCA files contain type library information that is necessary to compile the project.

RESOLUTION

Use one of the following workarounds to compile the project without errors:

  • Open the project in Visual Basic, and make a change in the project. Any change, such as entering a space and then deleting the space in the project, will suffice. Close Visual Basic, and save the changes. This rebuilds the .DCA files for the application in the same directory where the .DSR files are located.
  • Compile the application inside of the Visual Basic Integrated Development Environment (IDE). This also rebuilds the .DCA files for the application.

STATUS

Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article...

It sounds like you need to CTRL-F5 and see what the compile error is, VB6 will allow you to run in debug while there are still errors that won't make it past the compiler, there is probably something that needs to be resolved. Here's a sample for compiling from the command line from a bat file.

set vssdir=c:\_vss\
VB6 /MAKE "%vssdir%Project.vbp" /outdir "%vssdir%testbuild"

Does the code build in the debugger?
Check the help available for the switches by running "vb6.exe /?" Something like:

path_to_vb6_exe /l path_to_my_project_name

should work. I'm thinking /l not /m as it's a webclass dll so will be activeX. Whenever I've had errors like the one you describe reported from VB6 run from the command line, it's been 'cos the code wouldn't build.

However it does have a few foibles when run from the command line. I found that if I had custom tabs for user controls set up in the IDE, the compile from the command line would always fail.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!