Unload a COM control when working in VB6 IDE

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

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)