Integrate VB6 with the VB6.5 IDE.

Featuring the VBA SDK v6.5 + Automatic interop with VS 2008 Shell & VB6Backporter


 

#denialism (de·​ni·​al·​ism | \ di-ˈnī(-ə)li-zəm): In psychology, denialism is a choice to deny reality as a way to avoid a psychologically uncomfortable truth.

  • How many other clones are there of VB6's IDE, with full intellisense, debugging, pre-compiling, and multi-project management?
  • How many other clones provide 100% core-language parity with the Visual Basic language?
  • How many other clones operate in the same memory space as Visual Basic?
  • How many other clones offer additional language features that extend the language into the modern era?
  • How many other clones claim "zero" bugs in the IDE/VBE?
  • Which of these clones is the fastest at manipulating and managing code modules?
  • How many milestones were delivered on time, exactly when the developer projected them to be complete?

Benefits of Visual Basic for Applications (VBA)

"When you host Visual Basic for Applications inside your application, you provide your users with the full power of Microsoft Visual Basic. The key technology that makes individual Windows applications programmable and also makes it easy for your users to create integrated solutions is the Component Object Model (COM) technology known as Automation (formerly called OLE Automation). Automation allows a developer to use VBA code to create and control software objects exposed by any application, dynamic-link library (DLL), or ActiveX® control that supports the appropriate programmatic interfaces."

The Visual Basic Editor (VBE)

"The Visual Basic editor provides you with the ability to create, modify, and debug code behind the application document. This integrated development environment exists outside the host application window, enabling developers to write code in VBA and simultaneously view the results of their programming in the host application. Although the Visual Basic editor exists outside the application window, it runs in the same memory space as its host, thereby benefiting from tight integration for event handling as well as enhanced performance."
 - Microsoft Visual Basic for Applications 6.0 Software Development Kit Version 6.4/6.5 Welcome Guide 

Background history 

1995 - 1997 - Doug Hodges (Software Architect for the Visual Studio IDE) had been working on the product vision to create an integrated extensible IDE since the VS5 timeframe circa 1995-1997.  The original design idea was going to use only VC tools to create an integrated shell, ie VC 5.0 Shell, which started the component interfaces that still exist today.

1998 - VS6 received a new COM-based shell that was developed to allow independently built things that were independent versions of each other to be plugged together.  This vision appeared to be a step backwards from a single shell, since now there were 3 Shells, ie VB, VJ++, and VC++.  Originally, the first extension of the shell was in the VS 6.0 timeframe and the extensibility APIs were not exposed yet.  VB6 was the final application host with intrinsic functions to compile native applications.  VBA 6 was embedded as the front end UI editor (VBE 6) of VB6.  

1999 - In late 1998 through 1999, VB.NET was being developed to support the notion of VB6 sourced projects that allowed you to edit and compile VB6 projects inside VB.NET.  However, in December of 1999 Microsoft decided to break compatibility with VB6.  Although, the Visual Basic Editor 6.0 version 6.x continued to be refined until 2007 with Visual Basic 6.5 (VBA 6.5 w/VBE 6.5), the final version that can be hosted.  In Office 2010, VBA 7/VBE 7 received 64-bit support, but no additional features were added.  In Office 2013-2016 there were very few changes to Visual Basic with VBA 7.1/VBE 7.1.   Although, Office for MAC was brought back in 2016 with a couple minor updates to VBA including a sandboxed environment by default.  We plan to patch compatibility with VB6, by building a custom language service that plugs into the Visual Studio 2008 Shell, so that we can save the syntax of the older language and extend its capabilities.

2000 - VS.NET (BETA 1) was released.

2001 - VS.NET (BETA 2) was the follow up to BETA 1, that had a time expiration.

2002 - Finally, in VS.NET 2002 a single Shell was completed to be fully extensible from the ground up and designed to have independent pieces that independently plugged together.  The goal was to be at least as useable as the VB product and the VC product combined, so the best features were picked from those two products.  It was felt by the team that if the requirements of VB and VC could be met, that the requirements of most language partners could probably be met too.  The VS.NET IDE was actually started as a clone of the VB6 code base.  Some code was originally inherited from VS6.  In the VS.NET IDE message looping, there is a thing called the Thunder Message Loop.  Thunder was the codename for Visual Basic and Ruby was the codename for the forms package.  Although, there probably isn't much of the old code leftover now, that you could point to as Thunder.

2008 - 2009 - The Visual Studio Shell was upgraded with new feature called "isolated mode", and it is the final version of VS that maintains legacy support.

10/31/18 - The first working IDE clone prototype of VB6 was released after only one month of development, as announced.  It was called VB6Backporter.exe, and it was written in VB.NET to handle VB6 projects.

12/31/18 - Just 2 months later, an early BETA of the Visual Basic 6.5 IDE (VB65.exe) was released, written with VB6.  It was actually backported to the VB6 format by/from its own code content (VB6Backporter.exe). There were only minor conversions left over that needed to be written by hand, so it saved a lot of development time overall.  It took 2 months because the VBA SDK had to be integrated with VB6 project formatting, and filtered out for any unused VBA project formatting and unrelated menu items.  The IDE wasn't that easy to customize.

Visual Basic 6.5 IDE (Latest version updates - 6/23/19) 

The integration classes included with the VBA SDK have now been heavily modified to emulate VB6's intrinsic features.  VB65.exe acts as the host application, with VBA embedded inside of it, sharing the same memory space.  Visual Basic 6.5 can create, open, edit, and save project (.vbp;.vbg;.bas;.cls;.frm) files.  It can also add/remove references and components.  The intrinsic functions of VB65.exe automate the compile process to build executable files in native or p-code format, provided that a licensed copy of Visual Basic 6.0 is installed.

The layout of the development environment and its features are nearly identical to that of VB6, except that the IDE has now been updated with modern icons and the newest features of VBA's IDE/VBE.    

  • Menu items can be dynamically customized by the developer with a lot of flexibility. 
  • Mouse-wheel and touch-pad input is automatically supported out-of-the-box.

This enhanced IDE is now flexible enough to implement all sorts of updates, since we have direct access to the object model and the events of VBA's IDE/VBE.  

  • Automatic "Pretty listing (reformatting)" is a great time saving feature similar to the VB.NET option.
  • Automatic insertion of end constructs, ie End If (optional).
  • Automatic insertion of close constructs, ie "" (optional).
  • Automatic initialization of dimensioned variables to be used as a quick constructor (optional).
  • Code folding allows developers to collapse and expand procedures, by right clicking the desired procedure and then selecting "Toggle Procedure Expansion" (optional) - does not work with numbered lines.  This will be updated so that an error handler will display the procedure name and line where the error was generated.
  • Toggle All Code Procedures (optional).
  • Any project changes outside of the code editor cause a warning message to be displayed, and there is an option to reload the external project changes, or keep the current project and re-save any open projects that may of been affected (optional).
  • An "Auto Syntax Check" notification is displayed in the menu bar to show any errors entered (after return key) on the previous line.  Visual Basic's "Auto Syntax Check" option can be turned off and overridden by the host application.  For example, the new syntax check actually checks to see if the last line called is a valid function or sub procedure, where the internal checker would allow an invalid or misspelled function/sub to be entered without any error notification at all.  This layer in between the code editor and the compiler will open up many possibilities for a Visual Basic hybrid language largely compatible with Visual Basic 6, VBA 6.5, and VB.NET 2005-2008 through optional Interop.

Known bugs of version 6/23/19 

  1. The project file would fail to build if you added a public module without a Sub Main defined. [Fixed]
  2. Some third party OCX controls that do not support the appropriate programmatic interface for VBA fail. [Request support]
  3. The application failed to load unless "Run As Administrator" is invoked.  [Right click VB65.exe and select the "Compatibility" tab.  Check off  "Run this program as administrator".  Click "Apply".]
  4. Some 32 bit operating system configurations cause the new "code formatting" options to fail, apparently the handles of child Windows are stored differently in VBA.  [Fixed]
  5. Customized menu items were not re-populating on load. [Fixed]

Development path

Current unreleased updates as of 8/13/19

  • The toolbox docks to the IDE Window.
  • A VB6Namespace template is now available in the new project dialog Window.
  • The code metric analyzer has been streamlined to reduce performance issues.

In 2004, Microsoft advertised the ability to create your own customizable VB6.0 IDE with this SDK.  We plan to hook up the intrinsic functions of VB6 to duplicate the look and feel as close as possible with the newer user interface [Complete].  Then, we will add extensive customizations to the IDE feature set and the process of compiling applications [Progressed].  A layer between the IDE UI and the compiler will be created to allow Visual Basic's Auto Syntax Checker to be overridden [Started].  Code input that normally would be rejected by the syntax checker can now be accepted by this visible UI layer [proto-typed].  At compile time, this layer is converted to extend functionality or optimize code execution, and input that normally might be accepted can be rejected or transformed to be more efficient [partially implemented].  At present, there are a few missing features that are still under construction.  

Options planned for 2019

  • Intrinsic VB6 Namespaces are missing from VBA 6.5, so those will be added to the available templates by default, ie app, clipboard, and printer. The VB6Namespace template is a group of classes written in VB6, to duplicate VB.NET functionality.  These groups of classes can be automatically instantiated at design time.  They are nested so that the developer can call on them in the same way that they would in a VB.NET IDE, similar to VB.NET Namespaces, but there isn't a need to reference a DLL.  At compile time, any unused or un-instantiated classes are to be excluded from the being compiled into the executable.  In fact, this is what the new IDE was developed to handle automatically when the build process starts.  Developers can get a fair portion of VB.NET code to compile in a VB6.x IDE, since many of the common Namespaces have duplicate classes visible within the scope of the project template chosen.  VB.NET Namespaces can also be directly accessed via interop.  This should become available later in the backporter version at some point.
  • Manual and automatic options to remove un-instantiated and/or unused classes before making a compiled executable file.

  • Work is being done to support some of the additional VB6 file formats that are missing from VBA, i.e. ctl, pag, and res, however only a little bit of progress has been made, but there is hope of limited support still.  An upgrade conversion is recommended for UserControls, to take advantage of the richer .NET versions and the new Threading Model.  A VB6 UserControl and a VB6 ActiveX Control is now equivalent to a .NET UserControl.  A VB6 ActiveX DLL is equivalent to a .NET Class Library.  A VB6 UserControl used in Web applications is equivalent to a .NET Web Control Library.

  • Full class properties are not available in VBA, so those VB6 code module properties will have to be handled by the host application. At present, a default header is written to the class files and other types of code modules.  A solution to this may be more involved than originally thought.  Progress on this may be delayed.

  • We are currently preparing for native compiler support by porting volumes of VB6 code forwards and backwards, to learn every interchange possible, while mapping out the code conversions.  The Visual Basic Back-porter originally written in VB.NET 2005 (Team suite) will be upgraded to VB.NET 2008 (Team suite) and integrated to work side-by-side with VB65.exe.  We have decided to use the proper tool for the job, Visual Studio 2008 SDK Version 1.0, aka Visual Studio 2008 Shell (VSX) and Version 1.1.  A prerequisite ISO of VS 2008 (Professional Trial) can still be downloaded here with MSDN library, although the minimum requirement for the 2008 SDK is VS 2008 (Standard edition).  Standard edition has the smallest installation, cleanest user interface, and it's the closest analog to VB6.  Unfortunately, VS 2008 (Express) is not supported.  Code input/output to/from the VB65 IDE can be managed within this NET application along with a custom Shell language Service.  There will be an option to view and synchronize the two VB code editors side by side, instantly verifying that the code conversion pre-compiles/parses at design time, or not.  Code conversions are applied dynamically as you type into either one of the code editors. [proofed]  The syntax checker/s will need subsequent updates of course.  "Visual Studio 2008 does not support any programming language, solution or tool intrinsically; instead, it allows the plugging of functionality coded as a VSPackage. When installed, the functionality is available as a Service. The IDE provides three services: SVsSolution, which provides the ability to enumerate projects and solutions; SVsUIShell, which provides windowing and UI functionality (including tabs, toolbars, and tool windows); and SVsShell, which deals with registration of VSPackages. In addition, the IDE is also responsible for coordinating and enabling communication between services.[11] All editors, designers, project types and other tools are implemented as VSPackages. Visual Studio uses COM to access the VSPackages."  "The Visual Studio 2008 Shell (isolated mode) lets developers create unique and isolated custom tools that run side-by-side with other versions of Visual Studio that are installed on a computer. The isolated Shell is optimized for specialized tools that can have full access to Visual Studio services but also have a custom appearance with extensive branding flexibility. Visual Studio features and menu command groups can be easily turned on and off. The application title, icon, and splash screen are fully customizable.  This Visual Studio SDK contains everything you need to start developing and testing your own isolated shell application based on Microsoft Visual Studio 2008 Shell (isolated mode) technology...  The Visual Studio 2008 Shell (integrated mode) integrates into Visual Studio on an end-user computer and enables your custom tools to have the look of Visual Studio. By using the integrated Shell, you can provide custom tools that your customers can use together with Visual Studio. Integrated mode is optimized for hosting language and software tool products.  The redistributable Visual Studio IDE does not contain programming languages and the features that support their respective project systems.  This IDE-only version of Visual Studio serves as a development platform to which developers can add their own development tools and programming languages."  When developing and experimenting with a package, Visual Studio uses a developer load key (DLK).  More info: Codemag  Screenshot:    Interestingly, Microsoft admits that if your VB6 application contains or relies heavily on any of the following, then keep it in VB6 and extend functionality to the existing binary file: OLE Container Control; Dynamic Data Exchange (DDE); DAO or RDO Data Binding; Visual Basic 5.0 Controls; DHTML; ActiveX Documents; Property Pages; Single-tier Database Applications; Visual basic Add-ins; Games; Graphics; Drag-and-Drop functionality; Variants; and Windows APIs.
  • Developers will be able to design VB.NET forms and add VB.NET components, including seamless interop access to the control's event handlers.  We can achieve this with Interop Forms Toolkit 2.0.  Support for VB.NET controls will have an option to catch the events of a .NET control by its VB6 name, or with its NET equivalent name (if any vice versa).  There is also a redistributable package.

Options planned for late 2019 - 2020+

  • An option to choose the preference of VB compilation (native; p-code, or IL/CLR with modern language features and 64 bit capability).
  • The developer's preference of syntax (vb6 or vb.net) may also be an option.  Some VB.NET keywords and features can compile to native code or p-code.  This will be fun to compliment the current VB syntax with VB.NET syntax.  For example, the "AndAlso" and "OrElse" keywords can supersede the "And" and "Or" keywords of VB6, since they execute in a superior way.  They "short-circuit" if any of the evaluations make the statement possible or not, rather than evaluate each and every condition regardless.  This strategy allows the developer to place the quickest expressions first, and the longer function calls or procedures after.  The slower expressions will execute only if the the earlier conditions have not short circuited the statement.  The keyword "AndAlso" will short circuit if a condition is false.  The "OrElse" keyword will short circuit if a condition is true. Similar features are also planned to improve the syntax closer to VB.NET standards without interfering with current syntax.  

Options planned for late 2021

  • A secure desktop environment will strengthen the security and integrity of the development process and the applications made within it.  Security was not an afterthought, the environment has already been developed, awaiting the final implementation.

Videos


 


 

Images

 Support


"Visual Basic for Applications, or VBA, is a distinct technology commonly used for application automation and macros inside of other applications, most commonly inside Microsoft Office applications. VBA ships as a part of Office and therefore the support for VBA is governed by the support policy of Office. However, there are situations where VBA is used to call or host Visual Basic 6.0 runtime binaries and controls. In these situations, Visual Basic 6.0 supported runtime files in the OS and the extended file list are also supported when used inside of a supported VBA environment.  For VB6 runtime scenarios to be supported inside VBA, all of the following must be true:

  1. The host OS version for VB runtime is still supported.
  2. The host version of Office for VBA is still supported.
  3. The runtime files in question are still supported."

- Support statement for Visual Basic on Windows, 1/17/18   

Licensing

Installation of Microsoft Office is not required for the IDE to work.  Interestingly, the VBA SDK version 6.0 had a 60 day time limit and can only be installed on 5 devices.  The VBA SDK's for versions 6.1 through 6.5 do not have a time limit imposed on the license for integrating, evaluating, and testing embedded VB projects. The applications that are ultimately created are made with a licensed copy of VB6 installed on the developer's machine.  "Effective July 1, 2015, Microsoft will no longer be requiring payment or reporting of royalties for those customers with VBA and/or VSTA Licenses. " -  Summit Software Company, FAQ about VBA SDK Support, 2018, http://summsoft.com/faq-about-vba-sdk-support/ 

Downloads