HeaderPane
Main
Hide
Share Link
Print

Distributing SftDate/OCX

This section describes the preferred distribution method when shipping SftDate/OCX with your application. This method 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 ensures that your application can be safely installed and use SftDate/OCX even if another vendor has already installed an application which also uses SftDate/OCX.

Supported platforms include Windows 10, Windows 11 and their server editions.

Installing SftDate/OCX (for an Application)

When distributing SftDate/OCX with your application, only the following files can be distributed with your application royalty-free. These files allow the use of the controls with your application. The design-time interface is no longer available once SftDate/OCX is shipped with your application. For additional information regarding distributing the controls with your application, see the license agreement.

Required Files

Important: Redistributable files are located in the SftDate/OCX installation directory (\Program Files (x86)\Softelvdm\SftDate OCX 2.0\Redist).

The OLE system files used by ActiveX controls (Oleaut32.dll and others) are part of Windows and must not be distributed. Both controls, the date field control (SftDate) and the month calendar control (SftCalendar), are contained in one OCX file. These files must be shipped with your application if SftDate/OCX is used:

File NameTarget FolderDescription
SftDate_IX86_U_20.ocxSee Control Target Directory belowRequired for 32-bit applications. SftDate/OCX controls. When distributing a managed .NET application compiled for "Any CPU", the 32-bit and 64-bit controls must be distributed.
SftDate_x64_U_20.ocxSee Control Target Directory belowRequired for 64-bit applications. SftDate/OCX controls. When distributing a managed .NET application compiled for "Any CPU", the 32-bit and 64-bit controls must be distributed.
Softelvdm.OCXHelperV2.dllSee SftHelperComponent Target Directory belowRequired for managed .NET Framework applications that use the SftHelperComponent or the OLECvt class ONLY. This .NET component is not used for other (unmanaged) languages, like VC++, and is not needed by .NET applications that don't use it (the samples don't). This file requires the .NET Framework 4.0 runtime or newer. Windows 10 and Windows 11 include .NET Framework 4.8.
Softelvdm.NETHelper.dllApplication FolderRequired for applications that use the SftHelperComponent ONLY - Applications compiled for "Any CPU" or "x86". If your application is compiled for "Any CPU" you will need both Softelvdm.NETHelper.dll and Softelvdm.NETHelper_x64.dll.
Softelvdm.NETHelper_x64.dllApplication FolderRequired for applications that use the SftHelperComponent ONLY - Applications compiled for "Any CPU" or "x64". If your application is compiled for "Any CPU" you will need both Softelvdm.NETHelper.dll and Softelvdm.NETHelper_x64.dll.

A .NET application also ships the interop assemblies Visual Studio generates for the controls, AxInterop.SftDateLib20.dll and Interop.SftDateLib20.dll, which are part of the application's build output.

The property pages (SftDate20PrPages.dll) and the DLLs they use are only used at design time and are not distributed.

GDI+ (Optional)

Certain features of the controls require GDI+ support. GDI+ is available automatically on all supported Windows platforms.

If GDI+ support is not available, the features are simply disabled and alternate presentation methods are used, if necessary.

Control Target Directory

Depending on the target operating systems, one of the following target directories can be chosen.

A) Windows\System32

Installing the ActiveX controls into the Windows System32 directory (or Windows\SysWOW64 for the 32-bit controls on 64-bit Windows) is possible on all supported Windows platforms.

The setup program you provide with your application should install the 64-bit controls SftDate_x64_U_20.ocx into the Windows System32 directory and the 32-bit controls SftDate_IX86_U_20.ocx into the Windows SysWOW64 directory (the System32 directory on 32-bit Windows). The Windows System directory name can be found using the GetSystemDirectory API function (GetSystemWow64Directory for the SysWOW64 directory). The directories are usually named C:\Windows\System32 and C:\Windows\SysWOW64.

The controls are installed into the Windows System32 (SysWOW64) directory and registered using proper versioning and reference counting of the OCX file (usually automatic, with most commercial installers).

B) Application Directory

An ActiveX control can be installed in the application directory using DLL/COM redirection.

DLL/COM redirection is activated on an application-by-application basis by the presence of a ".local" file. The ".local" file is an empty file in the same directory as the application's .exe file, with the same name as the application's .exe file with ".local" appended to the end of the name.

For example, to activate DLL/COM redirection for an application called "SampleApp.exe", create an empty file called "SampleApp.exe.local" in the same directory where SampleApp.exe is installed.

"Registration-Free Activation" (see below) can be used, which eliminates the need for the ".local" file.

Once DLL/COM redirection is activated, whenever the application loads a DLL or an OCX, Windows looks first for the DLL or OCX in the directory where the application's .exe file is installed. If a version of the DLL or OCX is found in the directory where the application's .exe file is installed, the application uses it regardless of any directory path specified in the application or the registry. If a version of the DLL or OCX is not found in the directory where the application's .exe file is installed, the normal search path or server path is used.

Even if DLL/COM redirection is used, the controls must be registered during installation (see "Registering SftDate/OCX" below). The controls must be installed into the Windows System32 (SysWOW64) directory and registered using proper versioning and reference counting of the OCX file (usually automatic, with most commercial installers). In addition, a private copy in your application directory is always installed (but not registered), along with the application's ".local" file.

SftHelperComponent Target Directory

The SftHelperComponent (see "Using SftDate/OCX with .NET") is used by .NET Framework applications only, and only by those that use it. It does not need to be registered using Regasm.exe for COM Interop. Simply copy the file Softelvdm.OCXHelperV2.dll to one of the following locations. They are listed in the order they are searched.

Softelvdm.OCXHelperV2.dll:

  • Same folder where the ActiveX controls are installed (see Control Target Directory above)
  • \Program Files\Common Files\Softelvdm\Softelvdm.Controls or \Program Files (x86)\Common Files\Softelvdm\Softelvdm.Controls (32-bit applications on 64-bit Windows versions only)
  • \Windows\System32 or \Windows\SysWOW64 (32-bit applications on 64-bit Windows versions only)

The actual path (\Program Files or \Windows) may differ due to localization.

Version Control

The setup program should only install the SftDate/OCX files if the version number in the new files is higher than the files already installed. Maintenance releases of the product are fully upward compatible and are guaranteed to have a newer version number. New major versions of the product will use new file names and new GUIDs so there will be no conflict between different major versions.

Reference Counting

When installing DLLs or OCX files into a "shared" location, such as the Windows\System32 or Windows\SysWOW64 directory, proper reference counting must be performed, to ensure that the file isn't uninstalled until all applications making use of the DLL or OCX have also been uninstalled. Reference counting is generally available with most commercial installers. The Windows Registry contains a count of all such shared files in the following Registry location:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\SharedDLLs

Registering SftDate/OCX

Depending on the target operating systems, one of the following ActiveX/COM registration methods can be selected.

A) Windows Registry

Registering the ActiveX controls in the Windows Registry is possible on all supported Windows platforms.

The setup program should register SftDate/OCX in the Windows registration database (Registry). This can be done manually using Regsvr32.exe which is discouraged. Many commercially available setup programs can register SftDate/OCX during the installation of your application. Please keep in mind that 64-bit versions of Windows have two versions of RegSvr32.exe. \Windows\System32\RegSvr32.exe is used to register 64-bit controls and \Windows\SysWOW64\RegSvr32.exe is used to register 32-bit controls. RegSvr32.exe must be run with elevated privileges as administrator.

SftDate/OCX is a self-registering ActiveX control. By using the LoadLibrary Windows API function, the GetProcAddress API can be used to obtain the DllRegisterServer function. By calling this function, the OCX registers both controls with the Windows registration database (Registry). 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. Please keep in mind that an application using the LoadLibrary API can only load the control of the same machine type, meaning a 32-bit application can only load and register 32-bit controls, a 64-bit application can only load 64-bit controls.

The following files need to be registered in this manner:

File NameDescription
SftDate_IX86_U_20.ocxRequired for 32-bit applications. SftDate/OCX controls
SftDate_x64_U_20.ocxRequired for 64-bit applications. SftDate/OCX controls

B) Registration-Free Activation

It is possible to deploy the ActiveX controls using "Registration-Free Activation". Registration-free activation allows distribution of the controls without the requirement to register the ActiveX controls in the Windows Registry (using REGSVR32 or a Setup application). Registration-free activation is supported by the operating system, so the .NET run-time is not required for registration-free activation.

By using registration-free activation, true XCOPY deployment is possible. Your application uses its own copy of the controls. Versioning, reference counting and registration of the controls are completely eliminated and other installed versions of the controls cannot interfere with your application.

By using an application manifest and copying the OCX file SftDate_IX86_U_20.ocx (for a 32-bit application) into your application directory, the ActiveX controls are automatically registered when they are used the first time. Your application manifest must include the comClass and typelib definitions shown below, one comClass definition for each control. These ensure that your application automatically registers the controls and uses the controls located in your application directory, regardless of any other controls or other versions of the same controls already installed or in use. A 64-bit application uses SftDate_x64_U_20.ocx and processorArchitecture="amd64".

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
 <assemblyIdentity version="1.0.0.0" processorArchitecture="x86" name="SoftelvdmInc.SftDateOCX20.Sample.exe" type="win32" />
 <description>SftDate Sample Application</description>
 <dependency>
  <dependentAssembly>
   <assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0"
   processorArchitecture="x86" publicKeyToken="6595b64144ccf1df" language="*" />
  </dependentAssembly>
 </dependency>

 <file name="SftDate_IX86_U_20.ocx">
  <comClass description="SftDate/OCX 2.0 Date Field Control" clsid="{0BE6EEF1-F37F-4CEB-B11F-B357B74F142B}"
   threadingModel="Apartment"
   miscStatus="setclientsitefirst,alignable,activatewhenvisible,insideout,cantlinkinside,recomposeonresize"
   progid="SftDateOCX20.SftDate.1" tlbid="{68CA8BA5-E67B-4117-89F7-4CF34C97D8C0}"/>
  <comClass description="SftDate/OCX 2.0 Month Calendar Control" clsid="{543C4960-1591-4083-BD4E-2A283D8E5B5D}"
   threadingModel="Apartment"
   miscStatus="setclientsitefirst,alignable,activatewhenvisible,insideout,cantlinkinside,recomposeonresize"
   progid="SftDateOCX20.SftCalendar.1" tlbid="{68CA8BA5-E67B-4117-89F7-4CF34C97D8C0}"/>
  <typelib tlbid="{68CA8BA5-E67B-4117-89F7-4CF34C97D8C0}" version="2.0" helpdir=""/>
 </file>
</assembly>

Testing a Setup Program

If you test the installation of your application's Setup program on a system where the development version of SftDate/OCX is installed, you may notice that you can no longer use SftDate/OCX in your development environment. This is caused by the fact that your Setup program installed a "run-time only" control on your system, which has replaced the "design-time" or development version of SftDate/OCX. You can reinstate (or re-register) the design-time version of SftDate/OCX by using the program entries "Register SftDate OCX in Windows Registry" and "Register SftDate OCX (64-bit) in Windows Registry" in the Maintenance folder of the SftDate OCX 2.0 program group.


Last Updated 11/29/2026 - (email)
© 2026 Softel vdm, Inc.