Unload a COM control when working in VB6 IDE

喜夏-厌秋 提交于 2019-12-04 22:14:00
Joel Spolsky

I'm pretty sure there's no good way to force VB6 to unload the control.

Here's what I do... instead of running Visual C and Visual Basic side-by-side, run VB6 under VC :

  1. Load up VC
  2. Open the project containing your COM objects
  3. Edit, change, etc.
  4. In VC, set the Output Executable to be VB6.EXE with appropriate command-line arguments to load the VB6 workspace
  5. Now just hit F5 to launch the VB6 IDE and load your VB6 project
  6. When you want to change the COM code again, exit VB6.EXE, make your changes, and hit F5 again. As long as you save your workspace VB6 will remember what windows you had open and all your project settings.

Advantages of this method:

  • You can set breakpoints in the COM object and debug it using a full source debugger
  • You can happily debug in C and VB at the same time
  • Whenever VB6 is running it always has the latest version of the COM DLLs
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!