You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

Installation

Installing the new SRP OLE Controls.

Files

The entire SRP OLE Control suite consists of several OCX files and one DLL file:


You may have more or less OCX files than is shown here. It depends on which controls your application is using. All controls are maintained within their own OCX file except for the following:


These controls are bundled into the SRPCore.ocx file since they are sold together.

Installing

In many cases, the SRP OLE Controls are installed automatically when you install any of the SRP Utilities available on our website. However, you'll need to be familiar with how the controls are installed, especially when you ship them with your own application.

The first step is to copy the OCX files onto the target machine. You can place these files anywhere you wish, but the wisest location would be your application folder. As an alternative, you can place them in the Windows System32 folder, if you want them located in a place that's accessible by any user. The choice is yours.

In order for your application to utilize the OCX files during runtime, Windows needs to know where to find the OCX files. This is done throught registration. When you register an OCX file, entries are placed in the registry detailing the OCX file's location, the types of controls within the OCX, and more. This information allows your application, as well as any other applications, to quickly gain access to the SRP OLE Controls.

To register an OCX file, simply run the following command from a DOS prompt or from the Run window:

regsvr32 <ocxfile>


The regsvr32 command is built into Windows. It's sole purpose is to register and unregister self-registering DLLs. OCX files are considered self-registering DLLs, even though their extensions are different. Here's an example on how to register the SRP Core Controls form an OpenInsight directory:

regsvr32 C:\Revsoft\Oinsight\SRPCore.ocx


If you have more than one OCX file, you must call regsvr32 for each one.

The Shared DLL

Along with your OCX files, there is one DLL file called SRPShared.dll. This DLL file contains the program logic that is common, or shared, between all OCX files. This helps reduce the overall size of all the SRP OLE Controls by eliminate redundant code. This also has the advantage of modularizing future updates.

In order for the OCX files to register, unregister, and execute, they must be able to see the DLL file. With OCX files, Windows used the registry. But the SRPShared.dll is not a self registering file. So, Windows must use a different technique to find it. Windows finds DLLs by looking in the following locations in the following top-down order:

  • The directory from which the application loaded
  • The current directory
  • The Windows System32 directory
  • The Windows System directory
  • The Windows directory
  • The directories that are listed in the PATH environment variable

So when it comes to installing the SRP OLE Controls, your safest bet is to place all the OCX files and the DLL file into either the application folder or the System32 directory. If you place them anywhere else, then you need to add that path to your machine's PATH environment variable.

The same goes for running regsvr32. If you try to run regsvr32 from a directory other than the one containing your OCX and DLL files, then it will return with an error.

Updating

We update our controls on a frequent basis to ensure you always have the most complete and robust controls available. To update your OCX files, simply replace them with the new OCX files. Then, register the new OCX files as if they were newly installed. In many cases, failing to re-register the new OCX files may not cause you any harm. But if the new OCX file has new properties, methods, or events, you may find that those new elements are inaccessible. To be safe, always register new OCX files. You do not need to un-register old OCX files before registering the new ones.

Uninstalling

To uninstall the SRP OLE Controls, you first need to unregister each OCX file. You can use the regsvr32 command. The syntax for unregistering your files is:

regsvr32 -u <ocxfile>

Upgrading from SRP.OCX

Upgrading from SRP.OCX to the new SRP OLE Controls.

If you've been using the SRP.OCX (SRP OLE Controls version 1.9.2 or earlier), and are thinking about upgrading to the 2.0 version of one or more controls, there are some things you need to know.

Breaking Change

Due to the way the controls are now structured, there is one breaking change you must be prepared to fix in your application. This change is in the usage of option buttons. The SRP Button Control's AddOptionButton and RemoveOptionButton methods no longer work.

In the SRP.OCX, you were able to add option buttons by using either the SRP Button Control or the SRP Subclass Control. Since they were in the same OCX file, they could work together without problem. Once the SRP Subclass Control was moved into it's own OCX file, a dangerous possibility emerged. If the SRP Subclass Control tried to subclass an EDITLINE already subclassed by the SRP Button Control, a fatal exception could occur, crashing the application. So, the decision was made to end support for the SRP Button Control's AddOptionButton and RemoveOptionButton methods.

So, if you plan to use the SRPCore.ocx, and you currently use the aforementioned methods, you need to update your application to use the SRP Subclass Control instead. Please see the help documents for the SRP Subclass Control for details on how to implement option buttons.

Using Only 2.0 Controls

If you plan to upgrade entirely to the new SRP OLE Controls, then upgrading is fairly simple. First, unregister the current SRP.OCX file using the following command:

regsvr32 -u <path>\SRP.OCX


Delete the SRP.OCX and register all the new OCX files individually. For example, register the SRP EditTable Control using:

regsvr32 <path>\SRPEditTable.ocx


See the Installation guide above for more details on registering OCX files.

Using Both SRP.OCX and 2.0 Controls

If you are upgrading only a subset of your controls to the new SRP OLE Controls, then you'll need to keep both the SRP.OCX registered as well as the new controls. There is no problem with this as long as you take the following precaution:

Always make sure SRP.OCX is registered before any of the new SRP OLE Controls are registered. For example, let's say you are upgrading only the SRP ReportTable Control. When registering your OCX files, do this:

regsvr32 <path>\SRP.OCX 
regsvr32 <path>\SRPReportTable.ocx


The reason order is so important is quite simple when you consider that the SRP.OCX contains the same controls (albeit older versions) as the new OCX files. When you register the SRP.OCX file, it's like telling Windows that the SRP Button Control, SRP EditTable Control, SRP ReportTable Control, etc. are all located in SRP.OCX. When you register the SRPReportTable.ocx file, it's like telling Windows that the SRP ReportTable Control is location in SRPReportTable.ocx. So, if you register the SRP.OCX after registering the SRPReportTable.ocx, then the older version of the SRPReportTable.ocx is the one registered in the system.

  • No labels