Navigation:  Programming Cookbook > Creating COM Components > Testing & Debugging > Debugging Out-of-Process >

On Demand Session

Previous pageReturn to chapter overviewNext page

Once the server is working successfully when pre-started, the next step is to try having it started on-demand. In order for this to work the registry entries must be correct (see Registering the Component).

The development image, when started as an out-of-process debug server, will be started up in headless mode, and no development windows will be opened (with the exception of the splash screen). In order to do any debugging, therefore, it is necessary to set a breakpoint in an appropriate place before saving down the server image. For example we could set a breakpoint in the COMRandomStream>>Next: method:

 

Next: next

       "Private - Implement IRandomStream::Next().

       Answer the next pseudo-random number in the sequence defined by the receiver

       via the [out] parameter, next."

 

       self halt.

       next value: (stream next * (upperBound-lowerBound) + lowerBound) asInteger.

       ^S_OK

 

 

If we now re-save the server image (ensuring it has a class factory registration as we are attempting to debug out of process) we can start an instance of RandomVBClient.Exe and observe the normal walkback dialog pop up when we press the Next button in the client. At this point one can start debugging in the normal way, and use the debugger to launch browsers, etc, as required.