Registering the CdoHelper Component

As with all ActiveX components, the CdoHelper component must be registered before it is used. Registering means adding information about the component to the Windows Registry so that client applications know where the component is. This step is often performed by an automated installation process, but for the CdoHelper component it must be done manually. To do so, choose Run from the Start menu, and enter:

regsvr32 path\CdoHelper.dll

where path is the full path of the folder containing CdoHelper.dll. For example, if the sample code was extracted to the C:\ drive root folder, the command is:

regsvr32 C:\vbmsg\Samples\CdoHelper\CdoHelper.dll

After the component is registered, it can be used in Visual Basic by setting a reference to O’Reilly CDO Helper 1.0. See Chapter 6 for further information.

If desired, the CdoHelper component can be unregistered by running the regsvr32 program again, this time specifying the -u switch (for “unregister”). A typical command would look like this:

regsvr32 -u C:\vbmsg\Samples\CdoHelper\CdoHelper.dll

Tip

Your computer should already have the regsvr32 program on it, but if it doesn’t, you can download it from Microsoft by following these steps:

  1. Go to http://support.microsoft.com/support/downloads/dp2439.asp.

  2. Click the link to download regsv32a.exe. This is a self-extracting executable file that contains regsvr32.exe.

  3. Download the file to your computer’s System folder (on Windows 9x systems) or to the System32 folder (on Windows ...

Get CDO & MAPI Programming with Visual Basic: now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.