|
In the Window painter you can link or embed objects. You can select OLE 2.0 from the Controls menu bar item in the Window painter, or you can use the icon, .
When you place an OLE 2.0 control on a window, you will be prompted with the standard Insert Object dialog, which allows you to embed an object, embed a file, or link to a file. If you do not want to assign an object to the control, select Cancel. Using new PowerScript functions, you will be able to assign objects at runtime.
If you select the Create New radio button, you can choose from a list of applications which are registered as OLE 2.0 servers. If you select one, the application will be started with a new instance of the applications object, and you will be able to use the application as you wish. For example, if you choose Microsoft Excel 5.0 Worksheet, you automatically switch into Excel with a new Excel worksheet. When you exit the application, an image of the object will appear in your OLE 2.0 control on your window.
If you select the Create from File radio button, you will then be prompted for a file name. Once you select a file, the application which is associated with that files extension in the Windows Registration Editor will be started and that file will be active. For instance, if you choose README.DOC, Microsoft Word will be started and the file README.DOC will be opened and active. After you exit the application, the object will be embedded into your OLE 2.0 control. The contents of the file will be copied into your object. Any changes made to the original file will not show up in your object.
If you want to have your OLE 2.0 control linked to the original file, thereby sharing the data, you must check the Link checkbox.
See Also
OLE Automation functions
OLE Control functions
|