User Tools

Site Tools


oledirectory_get_list_of_installed_ole_ocx_.htm
Navigation:  Language Reference > App A - DDE, OLE, and OCX > Object Linking and Embedding >====== OLEDIRECTORY (get list of installed OLE/OCX) ====== Previous pageReturn to chapter overviewNext page

OLEDIRECTORY( list , flag [, bits ] )

blk2blue.jpg

OLEDIRECTORY Gets a list of all installed OLE servers or OCX controls.
list The label of the QUEUE structure to receive the list.
flag An integer constant or variable that determines whether to get a list of OLE servers (flag = 0) or OCX controls (flag = 1).
bits An integer constant or variable that determines whether to get a list of 16-bit or 32-bit OCX controls. If one (1), it returns 16-bit OCX controls. If two (2), it returns 32-bit OCX controls. If three (3), it returns both 16-bit and 32-bit OCX controls. If omitted or zero, 16-bit programs return 16-bit OCX controls and 32-bit programs return 32-bit OCX controls.

Note: With 16-bit support deprecated in this release, the 32-bit mode should be used exclusively.

OLEDIRECTORY gets a list of all installed OLE servers or OCX controls and places it in the list QUEUE. The list QUEUE must be declared with the same structure as the OleQ QUEUE declaration in EQUATES.CLW:

OleQ QUEUE,TYPE

Name CSTRING(64) !Name of the OLE Server application

CLSID CSTRING(64) !Unique identifier for the operating system

ProgID CSTRING(64) !Registry name, such as: Excel.Sheet.5

END

Example:

ResultQ QUEUE(OleQ).         !Declare ResultQ the same as OleQ QUEUE in EQUATES.CLW

CODE

OLEDIRECTORY(ResultQ,0)     !Get list of installed OLE Servers & put it in ResultQ

                            !then let the user pick one:

?OleControl{PROP:Create} = SelectOleServer(ResultQ)

!User's OLE Server choice procedure:

SelectOleServer PROCEDURE(OleQ PickQ)

window WINDOW('Choose OLE Server'),AT(,,122,159),CENTER,SYSTEM,GRAY

       LIST,AT(11,8,100,120),USE(?List),HVSCROLL, |

        FORMAT('146L~Name~@s64@135L~CLSID~@s64@20L~ProgID~@s64@'),FROM(PickQ)

       BUTTON('Select'),AT(42,134),USE(?Select)

      END

CODE

OPEN(window)

SELECT(?List,1)

ACCEPT

 CASE ACCEPTED()

 OF ?Select

  GET(PickQ,CHOICE(?List))

  IF ERRORCODE() THEN STOP(ERROR()) END

  POST(EVENT:CloseWindow)

 END

END

RETURN(PickQ.ProgID)

oledirectory_get_list_of_installed_ole_ocx_.htm.txt · Last modified: 2021/04/15 15:57 by 127.0.0.1