John Chamberlain
Visual Basic Compile Controller
Visual Basic Compile Controller

Central site for the Compiler Controller. I will post any relevant information such as notes, updates, corrections, etc.

Current as of 3 November 2003.

Compile Controller Package - February 2001
This is the newest revision from February 2001.[VB5/6] [CC-2001february.exe] [266 kb] [15 Feb 2001]

Please Read the On-Line Materials Before Sending Me Questions
The on-line package for the article (available via the link above) contains detailed information on the Compile Controller in a word document. Please check it first.

The microsoft assembler is no longer available. BG apparently thinks assembly language programming is dead. Try NASM instead.

The division by 2 optimization example is exaggerated
In the article example I deliberately used floating point division and did not compile with floating point optimizations. It is possible to make a normal exe that performs much better than the default case I show.

Register Assumed to Error assembler error
If you are getting this error while trying to assemble a listing for a form or class module the reason is that the flat model (see the first part of the "if" directive at the top of the listing) only includes the CS, DS, ES, and SS registers, whereas VB also uses the FS register for exception handling (see Pietrek article on MSDN). To make the FS register flat, add a line after the model directive which says: "ASSUME FS: FLAT".

Custom Module is Crashing - Unnamed different in class modules
If your hand-assembled module links, but crashes on execution there is a good chance it is because you have not broken out the "unnamed variables" (see Task 3 in the guide). Important Note: the unnamed variables in class/form modules go by the name of the encapsulating procedure. For example, if the procedure is called "DoSomething" then the unnamed variables in that procedure will be called "_DoSomething$". Example of analyzing and breaking out unnamed variables in a class module.

Possibly Better Way to Rebuild Object Module
A potentially better way to rebuild your object module is to use an object module disassembler. I have heard that Watcom, for example, has an object module disassembler. It may give a better disassembly of VB's obj files than the source listing generated automatically by the compiler, but I have not tried it so I do not know for sure.