|
|
Distributing the HCS12(U) ActiveX ControlThis section describes a couple of methods to be used when shipping the Hcs12(u) ActiveX with your application. These methods follows Microsoft's guidelines on ActiveX control distribution. While these guidelines are not enforced, it is highly recommended that they are followed as outlined here. This insures that your application can be safely installed. Required Files Important: Redistributable files are located in the HCS12(u) ActiveX installation directory (\HCS12(u)-1.0\Redist). These files must be shipped with your application if HCS12(u) ActiveX is used:
Target Directory The setup program you provide with your application should install the Hcs12(u) AxtiveX control Hcs12(u).ocx into a special subdirectory of the Windows System directory, perhaps with the name derived from the name of your company or product. The Windows System directory name can be found using the GetSystemDirectory API function. All other files shown in the above table have to be installed into the Windows System directory. On Windows 95/98/ME, the Windows System directory is usually named C:\WINDOWS\SYSTEM or on Windows NT/2000/XP it is usually named C:\WINNT\SYSTEM32. Registering the control Before the control can be used, the setup program should register the ActiveX in the Windows registration database (Registry). This can be done manually using Regsvr32.exe which is included in the \Redist subdirectory. Many commercially available setup programs can register automatically the Hcs12(u).ocx ActiveX during the installation of your application. If you choose RegSvr32.exe, just pass the complete path and filename of the control .OCX file as an argument to RegSvr32. If you prefer, you can write your setup program to register the control directly instead. Use the LoadLibrary Windows API to load the control DLL. Next, use GetProcAddress to obtain the address of the "DllRegisterServer" function. Finally, call the DllRegisterServer function. Most commercially available setup programs have support for this built-in. Check the documentation of your setup application for information on how to install ActiveX controls. |
|