Information on ComponentWorks Redistributable Files And Distribution of Applications using ComponentWorks Controls Files The files in the \Setup\redist directory of the ComponentWorks CD are necessary for distribution of applications that use ComponentWorks controls. You need to distribute only those files that are necessary for the controls that your application uses. Distribution When you install on another computer an application that uses ComponentWorks controls, you must also install the necessary control files (OCXs) and supporting libraries on the that computer. Furthermore, you must also register each of the OCX files with the operating system. This allows your application to find the correct OCX files and create the controls. If your application performs any I/O operations such as data acquisition or GPIB, then you must also install and configure the driver software and corresponding hardware on the target computer. Consult your driver documentation for more information. When distributing applications that use the ComponentWorks controls, do not violate the license agreement provided with the software. If you have any questions about the licensing agreement, contact National Instruments. Automatic Installers Many programming environments include a tool or wizard that facilitates the creation of installers (also known as setup programs or distribution kits). An installer allows you to distribute your application on other computers. This tool must recognize which control files and supporting libraries are required by your application and must include these in the installer that it creates. The resulting installer must also register the controls on the target machine. Some of these tools like the Visual Basic 5.0 Setup Wizard use dependency files (.DEP) to determine the files required by each OCX file. Each of the ComponentWorks OCX files has a corresponding dependency file that is located in the \Windows\System (\Windows\System32 for WindowsNT) directory after you install the ComponentWorks software. Some setup tools may not automatically recognize the files that are required by an application but will provide you with the option to add additional files to the installer. In this case, add the necessary OCX files (corresponding to the controls that you use in your application) as well as all the DLL and TLB files in the \redist directory. You should also verify that the resulting installer does not copy older versions of a file over a newer version on the target machine. If your programming environment does not provide a tool or wizard to build an installer you may use other third party tools like InstallShield. Some programming environments provide simplified or trial versions of third party installer creation tools on their installation CDs. Manual Installation If your programming environment does not include a tool for creating installers, you must build your own or perform the installation task manually. To install your application on another computer, follow these steps: Copy the application executable to the target machine Copy all required ComponentWorks OCX files (corresponding to the controls used in your application) to the System directory (\Windows\System for Windows 95 or \Windows\System32 for WindowsNT) on the target machine Copy all the required DLL and TLB files in the \redist directory to the System directory on the target machine Copy any other DLLs and support files required by your application to the System directory on the target machine. Some of these files may already be installed on the target machine. In this case, if the file on the target machine has an earlier version number than the file in the \redist directory, copy the newer file to the target machine. After copying the files to the target machine, you must register all OCX files with the operating system. To register an OCX file you need a utility such as REGSVR32.EXE. You must copy this utility to the target machine in order to register the OCX files, but you can delete it afterwards. Use this utility to register each OCX file with the operating system. For example, regsvr32 c:\windows\system\cwui.ocx DataSocket Server If your application uses the DataSocket Server, you might also need to distribute the server with your application. To distribute the DataSocket Server, copy the server executable to the target machine; you will also need to register it by running it with the command line option /regserver. It requires the same support libraries as the ComponentWorks DataSocket control. With the DataSocket server you should also distribute the server configuration file (CWDSSINI.DSS). This will start the server on the target in the same state that was configured on your development machine. You may also distribute multiple configuration files to switch between different setups of the server. In rare cases, you might also want to distribute the DataSocket Server Manager utility with your application. In general this should not be necessary. You will also need to register the DataSocket Server Manager with the command line option /regserver. Required redistibution files for each ComponentWorks control The following files are required for redistributing any ComponentWorks OCX: mfc42.dll msvcrt.dll oleaut32.dll olepro32.dll stdole2.tlb Redistribution of the 3DGraph (cw3dgrph.ocx) requires the following additional DLLs: msvcp50.dll Opengl32.dll (Windows 95 only - Do not overwrite an existing Opengl32.dll on the target system. Only install this file if it doesn't exist on the target machine) GLu32.dll (Windows 95 only - Do not overwrite an existing GLu32.dll on the target system. Only install this file if it doesn't exist on the target machine) Redistribution of DataSocket (cwds.ocx), as well as the DataSocket Server, requires the files needed for all basic ComponentWorks controls, plus the following files: asycfilt.dll comcat.dll axdist.exe (you will need to run this executable) In addition, the following files are required for redistributing the DataSocket Server Manager (cwdssmgr.exe): comctl32.dep comctl32.ocx comdlg32.dep comdlg32.ocx msvbvm50.dll In addition to the files required for DataSocket, the following files are required for OPC browsing support: bvopcclient.dll The following files are required for redistributing the National Instruments OPC Demo Server: OPCDemo.exe (register with the /regserver command line option) opcproxy.dll dcom95.exe (for Windows95 only) Instrument Drivers If you are using any instrument drivers in your applications, you must distribute the instrument driver DLL file with your application. Copy the instrument driver DLL and necessary support DLL (INSTRSUP.DLL) to the target machine. Make sure you install and configure any required driver software, such as NI-488.2, on the target machine. ComponentWorks Evaluation Once the ComponentWorks OCX files are installed and registered on a target computer, your application can create the controls. In addition, you or your customer can also use the ComponentWorks controls in any compatible development environment in evaluation mode. You may also distribute the ComponentWorks reference files (from the \redist directory) with your application. This provides complete documentation to the ComponentWorks controls when used in evaluation mode. If you would like to use the ComponentWorks controls as a development tool on this target machine you must purchase another ComponentWorks development system. Contact National Instruments to purchase additional copies of the ComponentWorks software. Trouble Shooting Follow these steps to trouble shoot any problems you may have after installing your application on another computer. Application is not able to find an OCX file or is not able to create a control The control file or one of its supporting libraries is not copied on the computer. Make sure the correct OCX files and all their supporting libraries are copied on the machine. In some cases a control may be built on top of another control requiring multiple OCX files for one control. The control is not properly registered on the computer. Make sure you run the registration utility and that it successfully registers the control. Controls in application run in evaluation (demo) mode The application does not contain the proper runtime license. When developing your application make sure the controls are running in a fully licensed mode. When building an executable for your application most programming environments automatically include a runtime license for the controls in the executable. Certain programming environments or specific types of application may not do this automatically. If you are developing an application in Visual C++ using SDI (single document interface) or MDI (multiple document interface) you must include the runtime license in the program code for each control you create. Consult the ComponentWorks documentation, National Instruments Knowledgebase (www.natinst.com/support) or technical support if you are not familiar with how to do this. If you are developing a dialog based application in Visual C++ this is done automatically for you.