Navigation:  Programming Cookbook > Creating COM Components >

Testing & Debugging

Previous pageReturn to chapter overviewNext page

Dolphin XP allows one to test and debug the COM components one has implemented in 3 different ways:

1.In-image
2.In-process
3.Out-of-process

When implementing a COM component in Dolphin, we can develop and test it easily and effectively within the same image. We refer to this as working in-image. Ultimately, however, the point of COM is to permit language-independent, binary, component re-use, so eventually one will need to venture outside Dolphin and use an external client, connecting to a Dolphin server running either in-process (as a DLL hosted in the client) or out-of-process (as a separate executable). Even when using an external client one does not have to lose the advantages of image-based development.

In both of the latter two cases a launcher stub is registered for the component that is then responsible for finding and loading the relevant development image. When loaded in-process the Dolphin development system will actually be running inside the host executable. When running out-of-process (or as a Local Server in COM terminology) the development system will be launched as a separate executable. In either case the full range of development tools can be used, including the full facilities of the Debugger. One can set breakpoints in the implementation of a component’s public interface methods and have the Debugger launched when the client calls them. The client's thread will be suspended until Dolphin returns from the method. One can program in the debugger to flesh out the component implementation as it runs, refactor, evaluate expressions, and generally make any changes one desires as long as the COM interfaces being used by the client remain stable.

In this section we will be using the “COM Random Stream” sample as our example. Before proceeding it is a good idea to try deploying this package as a DLL and running it inside the test VB client executable supplied with Dolphin XP Pro - see Deploying & Running the Random Stream Sample. Even if you do not follow all the steps to deploy and test the sample, you must ensure that at the very least the type library is registered in order that marshalling support is available for the IRandomStream interface used in the sample.