1 / 7

Using ActiveX in AP 145 Applications

Using ActiveX in AP 145 Applications. David Liebtag. Title slide. ActiveX Controls. An ActiveX control is a reusable software component based on the Component Object Model (COM). An ActiveX control can draw itself, respond to events (such as mouse clicks),

rafiki
Download Presentation

Using ActiveX in AP 145 Applications

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Using ActiveX in AP 145 Applications David Liebtag Title slide

  2. ActiveX Controls An ActiveX control is a reusable software component based on the Component Object Model (COM). An ActiveX control can draw itself, respond to events (such as mouse clicks), and be managed through properties, methods, and events. ActiveX controls are available both as part of Windows and from third party vendors. Basic text slide

  3. Syntax: Control←CREATECTL Parent 'ACTIVEX' Style Id CtlData Where CtlData is a: • Program identifier, i.e. MSComCtl2.MonthView.2 • Class identifier, i.e. {232E456A-87C3-11D1-8BE3-0000F8754DA1} • URL, i.e. http://www.microsoft.com • Reference to an Active document, i.e. file://\\Documents\MyDoc.doc • HTML fragment, i.e. MSHTML:<body>Hello World</body> The APL2 dialog editor also supports ActiveX controls. Basic text slide

  4. Creating ActiveX Controls: )LOAD 2 GUITOOLS SAVED 2008-04-23 21.46.49 (GMT-4) ⍝ Create a dialog DIALOG←UNICREATEDLG 'SHELL SIZEBORDER MAX MIN’ ⍝ Create an ActiveX control CTLDATA←'MSHTML:<body>Hello World!</body>' CONTROL←CREATECTL DIALOG 'ACTIVEX' '' 32776 CTLDATA Use GUITOOLS utility functions SET_PROPERTY and GET_PROPERTY to access control properties such as position and size. Basic text slide

  5. COM Properties and Methods: Use the COM OBJECT property to get the handle of the ActiveX control's COM object. XOBJECT←'COM OBJECT' GET_PROPERTY CONTROL Use the GUITOOLS utility function CALLCOM to access ActiveX objects’ methods, properties, and event handlers. The syntax of CALLCOM is identical to the syntax for the COM external function. VALUE←CALLCOM 'PROPERTY' XOBJECT 'Property' [Indices] CALLCOM 'PROPERTY' XOBJECT 'Property' [Indices] [Value] RESULT←CALLCOM 'METHOD' XOBJECT 'Method' [Parameters] Basic text slide

  6. COM Events: EVENTS←CALLCOM 'QUERY' 'EVENTS' XOBJECT CALLCOM 'HANDLERS' XOBJECT (1 2⍴'EventName' EventHandler) LOOP: EVENT←WAIT_EVENT 5 →(0=⍴EVENT)/LOOP →(0<DATATYPE (⎕IO+1)⊃EVENT)/COM_EVENT →AP145_EVENT COM_EVENT: (EVOBJECT NAME HANDLER CURSORPOS TIME NAMED POSITIONAL)←7↑EVENT →HANDLER Use the second element of the event array to determine whether the event was issued by AP 145 or an ActiveX object. For ActiveX object events, the second element is a character vector event name. For 145 events, it is an integer scalar message identifier. Basic text slide

  7. Let’s try some things,,, Basic text slide

More Related