Office star control in Delphi

zhaozj2021-02-16  45

Office Star Control is a graphic-based document processing control (similar to Word control), and the office star control completely encapsulates the text, graphics, forms, charts, etc. of office stars. Function, providing hundreds of programming interfaces; in the system of ERP, CRM, HR, OA, the development difficulty, statistics, reports, etc. The effect is exactly the same as reality. Office Star Control applies to various development tools of the Windows environment (such as VB, VC, Delphi, C Builder, PB, Java, etc.), and a large number of optimizations for web development environments. The following brief introduces the specific method of using office star control in Delphi: 1. Registering controls, such as the user download installed the office star control demonstration, the installer will automatically register the office star control during the installation process. In the system; if the user downloads the office star control, you need to register the control according to the following method: Click "Start" → "Run"; enter the following command in the Run dialog: Regsvr32 Register an ActiveX control Regsvr32 / U Remove the registration of an ActiveX control, adding a component If the office star control has been registered in the system, you can add it to the Delphi component panel, the specific steps are as follows: (1) Select Delphi Main Menu Component-> Import ActiveX Control, the system will also list all ActiveX controls that have been registered in the system in this dialog. (2) The list columns of the Import ActiveX dialog lists the Ostarocx2 Active Control Module (Version 1.0) item, select it, and then click the Install button to pop up the Install dialog box. In this dialog, you can set the position of the component in the information storage package. You can set it to the default packet already existing, or you can create this component information. If saved in the default package, the default package will contain the original component information. Delphi will uninstall the components that have been installed, so we will create a new package file here, as shown in the figure. (3) After clicking the OK button, the system will pop up the Pakage-OSTAR.DPK window and pop up a dialog box that confirms and install the package on it, as shown below. (4) Click the Yes button, the system will prompt the component to be installed successfully, and the ActiveX tab in the component bar adds the OSTAR component, and we can drag the component to the form for design. Note Problem: In Delphi6, if the program contains a program containing office star controls, the following prompts appear: [Warning] OSTAR.PAS (766): Return Value Of Function 'Tostarocx2.onopenfile' might be undefined The appearance The reason is because Delphi does not automatically write a function return value code when generating a code package with the Office Star control. Therefore, if this is encountered, it is necessary to manually add a return value code. The return value code is "Result: =", which is increased in front of the defaultinterface, for example: defaultinterface.onopenfile (strfilename); change to result: = defaultinterface.onopenfile (strfilename); Third, the use control has successfully installed the office star The control can be used directly.

转载请注明原文地址:https://www.9cbs.com/read-26987.html

New Post(0)